aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorEarnie Boyd <earnie@users.sf.net>2001-06-11 17:29:54 +0000
committerEarnie Boyd <earnie@users.sf.net>2001-06-11 17:29:54 +0000
commita179327987c7825123089c13779638b987c5fb49 (patch)
treeb66d511d3398e942da808496831a9d4403e4ce06 /winsup
parent43b44bc5ad877a2244750ba721142cae0a35d20b (diff)
downloadnewlib-a179327987c7825123089c13779638b987c5fb49.zip
newlib-a179327987c7825123089c13779638b987c5fb49.tar.gz
newlib-a179327987c7825123089c13779638b987c5fb49.tar.bz2
* include/basetsd.h: RC_INVOKED protection and realignment.
Thanks to: Colin Peters <colinpeters@users.sourceforge.net>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/w32api/ChangeLog5
-rw-r--r--winsup/w32api/include/basetsd.h65
2 files changed, 41 insertions, 29 deletions
diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog
index efb9847..2429402 100644
--- a/winsup/w32api/ChangeLog
+++ b/winsup/w32api/ChangeLog
@@ -1,4 +1,9 @@
+2001.06.11 Earnie Boyd <earnie@users.sourceforge.net>
+
+ * include/basetsd.h: RC_INVOKED protection and realignment.
+ Thanks to: Colin Peters <colinpeters@users.sourceforge.net>
+
2001.06.06 Earnie Boyd <earnie@users.sourceforge.net>
* Makefile.in (bindist): Reassign value of exec_prefix on make command
diff --git a/winsup/w32api/include/basetsd.h b/winsup/w32api/include/basetsd.h
index 732e513..3764900 100644
--- a/winsup/w32api/include/basetsd.h
+++ b/winsup/w32api/include/basetsd.h
@@ -1,5 +1,40 @@
#ifndef _BASETSD_H
#define _BASETSD_H
+
+#if defined(_WIN64)
+#define __int3264 __int64
+#define ADDRESS_TAG_BIT 0x40000000000UI64
+#else /* !_WIN64 */
+#define __int3264 __int32
+#define ADDRESS_TAG_BIT 0x80000000UL
+#define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
+#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
+#define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
+#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
+#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
+#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
+#define PtrToInt( p ) ((INT)(INT_PTR) (p) )
+#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
+#define PtrToShort( p ) ((short)(LONG_PTR)(p) )
+#define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
+#define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
+#define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
+#define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
+#endif /* !_WIN64 */
+
+#define UlongToPtr(ul) ULongToPtr(ul)
+#define UintToPtr(ui) UIntToPtr(ui)
+#define MAXUINT_PTR (~((UINT_PTR)0))
+#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
+#define MININT_PTR (~MAXINT_PTR)
+#define MAXULONG_PTR (~((ULONG_PTR)0))
+#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
+#define MINLONG_PTR (~MAXLONG_PTR)
+#define MAXUHALF_PTR ((UHALF_PTR)~0)
+#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
+#define MINHALF_PTR (~MAXHALF_PTR)
+
+#ifndef RC_INVOKED
#ifdef __cplusplus
extern "C" {
#endif
@@ -16,8 +51,6 @@ typedef __int64 INT_PTR, *PINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
typedef __int64 LONG_PTR, *PLONG_PTR;
typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
-#define __int3264 __int64
-#define ADDRESS_TAG_BIT 0x40000000000UI64
typedef unsigned __int64 HANDLE_PTR;
typedef unsigned int UHALF_PTR, *PUHALF_PTR;
typedef int HALF_PTR, *PHALF_PTR;
@@ -56,38 +89,11 @@ typedef int INT_PTR, *PINT_PTR;
typedef unsigned int UINT_PTR, *PUINT_PTR;
typedef long LONG_PTR, *PLONG_PTR;
typedef unsigned long ULONG_PTR, *PULONG_PTR;
-#define __int3264 __int32
-#define ADDRESS_TAG_BIT 0x80000000UL
typedef unsigned short UHALF_PTR, *PUHALF_PTR;
typedef short HALF_PTR, *PHALF_PTR;
typedef unsigned long HANDLE_PTR;
-#define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
-#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
-#define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
-#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
-#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
-#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
-#define PtrToInt( p ) ((INT)(INT_PTR) (p) )
-#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
-#define PtrToShort( p ) ((short)(LONG_PTR)(p) )
-#define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
-#define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
-#define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
-#define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
#endif /* !_WIN64 */
-#define UlongToPtr(ul) ULongToPtr(ul)
-#define UintToPtr(ui) UIntToPtr(ui)
-#define MAXUINT_PTR (~((UINT_PTR)0))
-#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
-#define MININT_PTR (~MAXINT_PTR)
-#define MAXULONG_PTR (~((ULONG_PTR)0))
-#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
-#define MINLONG_PTR (~MAXLONG_PTR)
-#define MAXUHALF_PTR ((UHALF_PTR)~0)
-#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
-#define MINHALF_PTR (~MAXHALF_PTR)
-
typedef ULONG_PTR SIZE_T, *PSIZE_T;
typedef LONG_PTR SSIZE_T, *PSSIZE_T;
typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
@@ -99,5 +105,6 @@ typedef unsigned __int64 UINT64, *PUINT64;
#ifdef __cplusplus
}
#endif
+#endif /* !RC_INVOKED */
#endif /* _BASETSD_H */