1 /* 2 * Compilers that uses ILP32, LP64 or P64 type models 3 * for both Win32 and Win64 are supported by this file. 4 */ 5 6 #ifndef __WINE_BASETSD_H 7 #define __WINE_BASETSD_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif /* defined(__cplusplus) */ 12 13 /* 14 * Win32 was easy to implement under Unix since most (all?) 32-bit 15 * Unices uses the same type model (ILP32) as Win32, where int, long 16 * and pointer are 32-bit. 17 * 18 * Win64, however, will cause some problems when implemented under Unix. 19 * Linux/{Alpha, Sparc64} and most (all?) other 64-bit Unices uses 20 * the LP64 type model where int is 32-bit and long and pointer are 21 * 64-bit. Win64 on the other hand uses the P64 (sometimes called LLP64) 22 * type model where int and long are 32 bit and pointer is 64-bit. 23 */ 24 25 /* Type model indepent typedefs */ 26 27 typedef char __int8; 28 typedef unsigned char __uint8; 29 30 typedef short __int16; 31 typedef unsigned short __uint16; 32 33 typedef int __int32; 34 typedef unsigned int __uint32; 35 36 // wogl 37 //typedef long long __int64; 38 //typedef unsigned long long __uint64; 39 typedef long __int64; 40 typedef unsigned long __uint64; 41 42 #if defined(_WIN64) 43 44 typedef __uint32 __ptr32; 45 typedef void *__ptr64; 46 47 #else /* FIXME: defined(_WIN32) */ 48 49 typedef void *__ptr32; 50 typedef __uint64 __ptr64; 51 52 #endif 53 54 /* Always signed and 32 bit wide */ 55 56 typedef __int32 LONG32; 57 typedef __int32 INT32; 58 59 typedef LONG32 *PLONG32; 60 typedef INT32 *PINT32; 61 62 /* Always unsigned and 32 bit wide */ 63 64 typedef __uint32 ULONG32; 65 typedef __uint32 DWORD32; 66 typedef __uint32 UINT32; 67 68 typedef ULONG32 *PULONG32; 69 typedef DWORD32 *PDWORD32; 70 typedef UINT32 *PUINT32; 71 72 /* Always signed and 64 bit wide */ 73 74 typedef __int64 LONG64; 75 typedef __int64 INT64; 76 77 typedef LONG64 *PLONG64; 78 typedef INT64 *PINT64; 79 80 /* Always unsigned and 64 bit wide */ 81 82 typedef __uint64 ULONG64; 83 typedef __uint64 DWORD64; 84 typedef __uint64 UINT64; 85 86 typedef ULONG64 *PULONG64; 87 typedef DWORD64 *PDWORD64; 88 typedef UINT64 *PUINT64; 89 90 /* Win32 or Win64 dependent typedef/defines. */ 91 92 #ifdef _WIN64 93 94 typedef __int64 INT_PTR, *PINT_PTR; 95 typedef __uint64 UINT_PTR, *PUINT_PTR; 96 97 #define MAXINT_PTR 0x7fffffffffffffff 98 #define MININT_PTR 0x8000000000000000 99 #define MAXUINT_PTR 0xffffffffffffffff 100 101 typedef __int32 HALF_PTR, *PHALF_PTR; 102 typedef __int32 UHALF_PTR, *PUHALF_PTR; 103 104 #define MAXHALF_PTR 0x7fffffff 105 #define MINHALF_PTR 0x80000000 106 #define MAXUHALF_PTR 0xffffffff 107 108 typedef __int64 LONG_PTR, *PLONG_PTR; 109 typedef __uint64 ULONG_PTR, *PULONG_PTR; 110 typedef __uint64 DWORD_PTR, *PDWORD_PTR; 111 112 #else /* FIXME: defined(_WIN32) */ 113 114 typedef __int32 INT_PTR, *PINT_PTR; 115 typedef __uint32 UINT_PTR, *PUINT_PTR; 116 117 #define MAXINT_PTR 0x7fffffff 118 #define MININT_PTR 0x80000000 119 #define MAXUINT_PTR 0xffffffff 120 121 typedef __int16 HALF_PTR, *PHALF_PTR; 122 typedef __uint16 UHALF_PTR, *PUHALF_PTR; 123 124 #define MAXUHALF_PTR 0xffff 125 #define MAXHALF_PTR 0x7fff 126 #define MINHALF_PTR 0x8000 127 128 typedef __int32 LONG_PTR, *PLONG_PTR; 129 typedef __uint32 ULONG_PTR, *PULONG_PTR; 130 typedef __uint32 DWORD_PTR, *PDWORD_PTR; 131 132 #endif /* defined(_WIN64) || defined(_WIN32) */ 133 134 typedef INT_PTR SSIZE_T, *PSSIZE_T; 135 typedef UINT_PTR SIZE_T, *PSIZE_T; 136 137 #ifdef __cplusplus 138 } /* extern "C" */ 139 #endif /* defined(__cplusplus) */ 140 141 #endif /* !defined(__WINE_BASETSD_H) */ 142 143 144 145