Moved all Win16 definitions out of the standard Windows headers.
[wine] / include / basetsd.h
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 typedef long long          __int64;
37 typedef unsigned long long __uint64;
38
39 #if defined(_WIN64)
40
41 typedef __uint32 __ptr32;
42 typedef void    *__ptr64;
43
44 #else /* FIXME: defined(_WIN32) */
45
46 typedef void    *__ptr32;
47 typedef __uint64 __ptr64;
48
49 #endif
50
51 /* Always signed and 32 bit wide */
52
53 typedef __int32 LONG32;
54 typedef __int32 INT32;
55
56 typedef LONG32 *PLONG32;
57 typedef INT32  *PINT32;
58
59 /* Always unsigned and 32 bit wide */
60
61 typedef __uint32 ULONG32;
62 typedef __uint32 DWORD32;
63 typedef __uint32 UINT32;
64
65 typedef ULONG32 *PULONG32;
66 typedef DWORD32 *PDWORD32;
67 typedef UINT32  *PUINT32;
68
69 /* Always signed and 64 bit wide */
70
71 typedef __int64 LONG64;
72 typedef __int64 INT64;
73
74 typedef LONG64 *PLONG64;
75 typedef INT64  *PINT64;
76
77 /* Always unsigned and 64 bit wide */
78
79 typedef __uint64 ULONG64;
80 typedef __uint64 DWORD64;
81 typedef __uint64 UINT64;
82
83 typedef ULONG64 *PULONG64;
84 typedef DWORD64 *PDWORD64;
85 typedef UINT64  *PUINT64;
86
87 /* Win32 or Win64 dependent typedef/defines. */
88
89 #ifdef _WIN64
90
91 typedef __int64 INT_PTR, *PINT_PTR;
92 typedef __uint64 UINT_PTR, *PUINT_PTR;
93
94 #define MAXINT_PTR 0x7fffffffffffffff
95 #define MININT_PTR 0x8000000000000000
96 #define MAXUINT_PTR 0xffffffffffffffff
97
98 typedef __int32 HALF_PTR, *PHALF_PTR;
99 typedef __int32 UHALF_PTR, *PUHALF_PTR;
100
101 #define MAXHALF_PTR 0x7fffffff
102 #define MINHALF_PTR 0x80000000
103 #define MAXUHALF_PTR 0xffffffff
104
105 typedef __int64 LONG_PTR, *PLONG_PTR;
106 typedef __uint64 ULONG_PTR, *PULONG_PTR;
107 typedef __uint64 DWORD_PTR, *PDWORD_PTR;
108
109 #else /* FIXME: defined(_WIN32) */
110
111 typedef __int32 INT_PTR, *PINT_PTR;
112 typedef __uint32 UINT_PTR, *PUINT_PTR;
113
114 #define MAXINT_PTR 0x7fffffff
115 #define MININT_PTR 0x80000000
116 #define MAXUINT_PTR 0xffffffff
117
118 typedef __int16 HALF_PTR, *PHALF_PTR;
119 typedef __uint16 UHALF_PTR, *PUHALF_PTR;
120
121 #define MAXUHALF_PTR 0xffff
122 #define MAXHALF_PTR 0x7fff
123 #define MINHALF_PTR 0x8000
124
125 typedef __int32 LONG_PTR, *PLONG_PTR;
126 typedef __uint32 ULONG_PTR, *PULONG_PTR;
127 typedef __uint32 DWORD_PTR, *PDWORD_PTR;
128
129 #endif /* defined(_WIN64) || defined(_WIN32) */
130
131 typedef INT_PTR SSIZE_T, *PSSIZE_T;
132 typedef UINT_PTR SIZE_T, *PSIZE_T;
133
134 #ifdef __cplusplus
135 } /* extern "C" */
136 #endif /* defined(__cplusplus) */
137
138 #endif /* !defined(__WINE_BASETSD_H) */
139
140
141