2 * Compilers that uses ILP32, LP64 or P64 type models
3 * for both Win32 and Win64 are supported by this file.
7 * Modified for use with MPlayer, detailed changelog at
8 * http://svn.mplayerhq.hu/mplayer/trunk/
11 #ifndef MPLAYER_BASETSD_H
12 #define MPLAYER_BASETSD_H
18 #endif /* defined(__cplusplus) */
21 * Win32 was easy to implement under Unix since most (all?) 32-bit
22 * Unices uses the same type model (ILP32) as Win32, where int, long
23 * and pointer are 32-bit.
25 * Win64, however, will cause some problems when implemented under Unix.
26 * Linux/{Alpha, Sparc64} and most (all?) other 64-bit Unices uses
27 * the LP64 type model where int is 32-bit and long and pointer are
28 * 64-bit. Win64 on the other hand uses the P64 (sometimes called LLP64)
29 * type model where int and long are 32 bit and pointer is 64-bit.
32 /* Type model indepent typedefs */
34 #ifndef __INTEL_COMPILER
40 typedef unsigned char __uint8
;
44 typedef short __int16
;
47 typedef unsigned short __uint16
;
54 typedef unsigned int __uint32
;
58 typedef long long __int64
;
61 typedef unsigned long long __uint64
;
66 typedef unsigned __int8 __uint8
;
67 typedef unsigned __int16 __uint16
;
68 typedef unsigned __int32 __uint32
;
69 typedef unsigned __int64 __uint64
;
71 #endif /* __INTEL_COMPILER */
75 typedef __uint32 __ptr32
;
76 typedef void *__ptr64
;
78 #else /* FIXME: defined(_WIN32) */
80 typedef void *__ptr32
;
81 typedef __uint64 __ptr64
;
85 /* Always signed and 32 bit wide */
87 typedef __int32 LONG32
;
88 //typedef __int32 INT32;
90 typedef LONG32
*PLONG32
;
91 //typedef INT32 *PINT32;
93 /* Always unsigned and 32 bit wide */
95 typedef __uint32 ULONG32
;
96 typedef __uint32 DWORD32
;
97 typedef __uint32 UINT32
;
99 typedef ULONG32
*PULONG32
;
100 typedef DWORD32
*PDWORD32
;
101 typedef UINT32
*PUINT32
;
103 /* Always signed and 64 bit wide */
105 typedef __int64 LONG64
;
106 typedef __int64 INT64
;
108 typedef LONG64
*PLONG64
;
109 typedef INT64
*PINT64
;
111 /* Always unsigned and 64 bit wide */
113 typedef __uint64 ULONG64
;
114 typedef __uint64 DWORD64
;
115 typedef __uint64 UINT64
;
117 typedef ULONG64
*PULONG64
;
118 typedef DWORD64
*PDWORD64
;
119 typedef UINT64
*PUINT64
;
121 /* Win32 or Win64 dependent typedef/defines. */
125 typedef __int64 INT_PTR
, *PINT_PTR
;
126 typedef __uint64 UINT_PTR
, *PUINT_PTR
;
128 #define MAXINT_PTR 0x7fffffffffffffff
129 #define MININT_PTR 0x8000000000000000
130 #define MAXUINT_PTR 0xffffffffffffffff
132 typedef __int32 HALF_PTR
, *PHALF_PTR
;
133 typedef __int32 UHALF_PTR
, *PUHALF_PTR
;
135 #define MAXHALF_PTR 0x7fffffff
136 #define MINHALF_PTR 0x80000000
137 #define MAXUHALF_PTR 0xffffffff
139 typedef __int64 LONG_PTR
, *PLONG_PTR
;
140 typedef __uint64 ULONG_PTR
, *PULONG_PTR
;
141 typedef __uint64 DWORD_PTR
, *PDWORD_PTR
;
143 #else /* FIXME: defined(_WIN32) */
145 typedef __int32 INT_PTR
, *PINT_PTR
;
146 typedef __uint32 UINT_PTR
, *PUINT_PTR
;
148 #define MAXINT_PTR 0x7fffffff
149 #define MININT_PTR 0x80000000
150 #define MAXUINT_PTR 0xffffffff
152 typedef __int16 HALF_PTR
, *PHALF_PTR
;
153 typedef __uint16 UHALF_PTR
, *PUHALF_PTR
;
155 #define MAXUHALF_PTR 0xffff
156 #define MAXHALF_PTR 0x7fff
157 #define MINHALF_PTR 0x8000
159 typedef __int32 LONG_PTR
, *PLONG_PTR
;
160 typedef __uint32 ULONG_PTR
, *PULONG_PTR
;
161 typedef __uint32 DWORD_PTR
, *PDWORD_PTR
;
163 #endif /* defined(_WIN64) || defined(_WIN32) */
165 typedef INT_PTR SSIZE_T
, *PSSIZE_T
;
166 typedef UINT_PTR SIZE_T
, *PSIZE_T
;
170 #endif /* defined(__cplusplus) */
172 #endif /* MPLAYER_BASETSD_H */