Fixed typo in BITMAPV4HEADER stucture.
[wine/wine64.git] / include / basetsd.h
blob559387bc944441c18a42769c56c820b08549e357
1 /*
2 * Compilers that uses ILP32, LP64 or P64 type models
3 * for both Win32 and Win64 are supported by this file.
5 * Copyright (C) 1999 Patrik Stridvall
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __WINE_BASETSD_H
23 #define __WINE_BASETSD_H
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* defined(__cplusplus) */
30 * Win32 was easy to implement under Unix since most (all?) 32-bit
31 * Unices uses the same type model (ILP32) as Win32, where int, long
32 * and pointer are 32-bit.
34 * Win64, however, will cause some problems when implemented under Unix.
35 * Linux/{Alpha, Sparc64} and most (all?) other 64-bit Unices uses
36 * the LP64 type model where int is 32-bit and long and pointer are
37 * 64-bit. Win64 on the other hand uses the P64 (sometimes called LLP64)
38 * type model where int and long are 32 bit and pointer is 64-bit.
41 /* Type model indepent typedefs */
43 #ifndef _MSC_VER
44 typedef char __int8;
45 typedef short __int16;
46 typedef int __int32;
47 #ifndef __MINGW__
48 typedef long long __int64;
49 #else
50 /* Using a typedef can tweak bugs in the C++ parser under Mingw32 */
51 #define __int64 long long
52 #endif /* !defined(__MINGW__) */
53 #endif /* !defined(_MSC_VER) */
55 typedef unsigned char __uint8;
56 typedef unsigned short __uint16;
57 typedef unsigned int __uint32;
59 #ifndef _MSC_VER
60 typedef unsigned long long __uint64;
61 #else
62 typedef unsigned __int64 __uint64;
63 #endif /* !defined(_MSC_VER) */
65 #if defined(_WIN64)
67 typedef __uint32 __ptr32;
68 typedef void *__ptr64;
70 #else /* FIXME: defined(_WIN32) */
72 typedef void *__ptr32;
73 #ifndef _MSC_VER
74 typedef __uint64 __ptr64;
75 #endif /* !defined(_MSC_VER) */
77 #endif
79 /* Always signed and 32 bit wide */
81 typedef __int32 LONG32;
82 typedef __int32 INT32;
84 typedef LONG32 *PLONG32;
85 typedef INT32 *PINT32;
87 /* Always unsigned and 32 bit wide */
89 typedef __uint32 ULONG32;
90 typedef __uint32 DWORD32;
91 typedef __uint32 UINT32;
93 typedef ULONG32 *PULONG32;
94 typedef DWORD32 *PDWORD32;
95 typedef UINT32 *PUINT32;
97 /* Always signed and 64 bit wide */
99 typedef __int64 LONG64;
100 typedef __int64 INT64;
102 typedef LONG64 *PLONG64;
103 typedef INT64 *PINT64;
105 /* Always unsigned and 64 bit wide */
107 typedef __uint64 ULONG64;
108 typedef __uint64 DWORD64;
109 typedef __uint64 UINT64;
111 typedef ULONG64 *PULONG64;
112 typedef DWORD64 *PDWORD64;
113 typedef UINT64 *PUINT64;
115 /* Win32 or Win64 dependent typedef/defines. */
117 #ifdef _WIN64
119 typedef __int64 INT_PTR, *PINT_PTR;
120 typedef __uint64 UINT_PTR, *PUINT_PTR;
122 #define MAXINT_PTR 0x7fffffffffffffff
123 #define MININT_PTR 0x8000000000000000
124 #define MAXUINT_PTR 0xffffffffffffffff
126 typedef __int32 HALF_PTR, *PHALF_PTR;
127 typedef __int32 UHALF_PTR, *PUHALF_PTR;
129 #define MAXHALF_PTR 0x7fffffff
130 #define MINHALF_PTR 0x80000000
131 #define MAXUHALF_PTR 0xffffffff
133 typedef __int64 LONG_PTR, *PLONG_PTR;
134 typedef __uint64 ULONG_PTR, *PULONG_PTR;
135 typedef __uint64 DWORD_PTR, *PDWORD_PTR;
137 #else /* FIXME: defined(_WIN32) */
139 typedef __int32 INT_PTR, *PINT_PTR;
140 typedef __uint32 UINT_PTR, *PUINT_PTR;
142 #define MAXINT_PTR 0x7fffffff
143 #define MININT_PTR 0x80000000
144 #define MAXUINT_PTR 0xffffffff
146 typedef __int16 HALF_PTR, *PHALF_PTR;
147 typedef __uint16 UHALF_PTR, *PUHALF_PTR;
149 #define MAXUHALF_PTR 0xffff
150 #define MAXHALF_PTR 0x7fff
151 #define MINHALF_PTR 0x8000
153 typedef __int32 LONG_PTR, *PLONG_PTR;
154 typedef __uint32 ULONG_PTR, *PULONG_PTR;
155 typedef __uint32 DWORD_PTR, *PDWORD_PTR;
157 #endif /* defined(_WIN64) || defined(_WIN32) */
159 typedef INT_PTR SSIZE_T, *PSSIZE_T;
160 typedef UINT_PTR SIZE_T, *PSIZE_T;
162 /* Some Wine-specific definitions */
164 /* Architecture dependent settings. */
165 /* These are hardcoded to avoid dependencies on config.h in Winelib apps. */
166 #if defined(__i386__)
167 # undef WORDS_BIGENDIAN
168 # undef BITFIELDS_BIGENDIAN
169 # define ALLOW_UNALIGNED_ACCESS
170 #elif defined(__sparc__)
171 # define WORDS_BIGENDIAN
172 # define BITFIELDS_BIGENDIAN
173 # undef ALLOW_UNALIGNED_ACCESS
174 #elif defined(__PPC__)
175 # define WORDS_BIGENDIAN
176 # define BITFIELDS_BIGENDIAN
177 # undef ALLOW_UNALIGNED_ACCESS
178 #elif !defined(RC_INVOKED)
179 # error Unknown CPU architecture!
180 #endif
182 #ifdef __cplusplus
183 } /* extern "C" */
184 #endif /* defined(__cplusplus) */
186 #endif /* !defined(__WINE_BASETSD_H) */