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
17 * Win32 was easy to implement under Unix since most (all?) 32-bit
18 * Unices uses the same type model (ILP32) as Win32, where int, long
19 * and pointer are 32-bit.
21 * Win64, however, will cause some problems when implemented under Unix.
22 * Linux/{Alpha, Sparc64} and most (all?) other 64-bit Unices uses
23 * the LP64 type model where int is 32-bit and long and pointer are
24 * 64-bit. Win64 on the other hand uses the P64 (sometimes called LLP64)
25 * type model where int and long are 32 bit and pointer is 64-bit.
28 /* Type model indepent typedefs */
30 #ifndef __INTEL_COMPILER
36 typedef unsigned char __uint8
;
40 typedef short __int16
;
43 typedef unsigned short __uint16
;
50 typedef unsigned int __uint32
;
54 typedef long long __int64
;
57 typedef unsigned long long __uint64
;
62 typedef unsigned __int8 __uint8
;
63 typedef unsigned __int16 __uint16
;
64 typedef unsigned __int32 __uint32
;
65 typedef unsigned __int64 __uint64
;
67 #endif /* __INTEL_COMPILER */
71 //typedef __uint32 __ptr32;
72 //typedef void *__ptr64;
74 #else /* FIXME: defined(_WIN32) */
76 typedef void *__ptr32
;
77 typedef __uint64 __ptr64
;
81 /* Always signed and 32 bit wide */
83 typedef __int32 LONG32
;
84 //typedef __int32 INT32;
86 typedef LONG32
*PLONG32
;
87 //typedef INT32 *PINT32;
89 /* Always unsigned and 32 bit wide */
91 typedef __uint32 ULONG32
;
92 typedef __uint32 DWORD32
;
93 typedef __uint32 UINT32
;
95 typedef ULONG32
*PULONG32
;
96 typedef DWORD32
*PDWORD32
;
97 typedef UINT32
*PUINT32
;
99 /* Always signed and 64 bit wide */
101 typedef __int64 LONG64
;
102 typedef __int64 INT64
;
104 typedef LONG64
*PLONG64
;
105 typedef INT64
*PINT64
;
107 /* Always unsigned and 64 bit wide */
109 typedef __uint64 ULONG64
;
110 typedef __uint64 DWORD64
;
111 typedef __uint64 UINT64
;
113 typedef ULONG64
*PULONG64
;
114 typedef DWORD64
*PDWORD64
;
115 typedef UINT64
*PUINT64
;
117 /* Win32 or Win64 dependent typedef/defines. */
121 typedef __int64 INT_PTR
, *PINT_PTR
;
122 typedef __uint64 UINT_PTR
, *PUINT_PTR
;
124 #define MAXINT_PTR 0x7fffffffffffffff
125 #define MININT_PTR 0x8000000000000000
126 #define MAXUINT_PTR 0xffffffffffffffff
128 typedef __int32 HALF_PTR
, *PHALF_PTR
;
129 typedef __int32 UHALF_PTR
, *PUHALF_PTR
;
131 #define MAXHALF_PTR 0x7fffffff
132 #define MINHALF_PTR 0x80000000
133 #define MAXUHALF_PTR 0xffffffff
135 typedef __int64 LONG_PTR
, *PLONG_PTR
;
136 typedef __uint64 ULONG_PTR
, *PULONG_PTR
;
137 typedef __uint64 DWORD_PTR
, *PDWORD_PTR
;
139 #else /* FIXME: defined(_WIN32) */
141 typedef __int32 INT_PTR
, *PINT_PTR
;
142 typedef __uint32 UINT_PTR
, *PUINT_PTR
;
144 #define MAXINT_PTR 0x7fffffff
145 #define MININT_PTR 0x80000000
146 #define MAXUINT_PTR 0xffffffff
148 typedef __int16 HALF_PTR
, *PHALF_PTR
;
149 typedef __uint16 UHALF_PTR
, *PUHALF_PTR
;
151 #define MAXUHALF_PTR 0xffff
152 #define MAXHALF_PTR 0x7fff
153 #define MINHALF_PTR 0x8000
155 typedef __int32 LONG_PTR
, *PLONG_PTR
;
156 typedef __uint32 ULONG_PTR
, *PULONG_PTR
;
157 typedef __uint32 DWORD_PTR
, *PDWORD_PTR
;
159 #endif /* defined(_WIN64) || defined(_WIN32) */
161 typedef INT_PTR SSIZE_T
, *PSSIZE_T
;
162 typedef UINT_PTR SIZE_T
, *PSIZE_T
;
164 #endif /* MPLAYER_BASETSD_H */