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