source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/minwindef.h@ 1170

Last change on this file since 1170 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 4.3 KB
Line 
1#ifndef _MINWINDEF_
2#define _MINWINDEF_
3
4#include <_mingw.h>
5#include <winapifamily.h>
6#include <specstrings.h>
7
8#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
9
10#if !defined (STRICT) && !defined (NO_STRICT)
11#define STRICT 1
12#endif
13
14#ifndef WIN32
15#define WIN32
16#endif
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifndef BASETYPES
23#define BASETYPES
24 typedef unsigned __LONG32 ULONG;
25 typedef ULONG *PULONG;
26 typedef unsigned short USHORT;
27 typedef USHORT *PUSHORT;
28 typedef unsigned char UCHAR;
29 typedef UCHAR *PUCHAR;
30 typedef char *PSZ;
31#endif
32
33#define MAX_PATH 260
34
35#ifndef NULL
36#ifdef __cplusplus
37#ifndef _WIN64
38#define NULL 0
39#else
40#define NULL 0LL
41#endif
42#else
43#define NULL ((void *)0)
44#endif
45#endif
46
47#ifndef FALSE
48#define FALSE 0
49#endif
50
51#ifndef TRUE
52#define TRUE 1
53#endif
54
55#ifndef _NO_W32_PSEUDO_MODIFIERS
56#ifndef IN
57#define IN
58#endif
59
60#ifndef OUT
61#define OUT
62#endif
63
64#ifndef OPTIONAL
65#define OPTIONAL
66#endif
67#endif /* _NO_W32_PSEUDO_MODIFIERS */
68
69#undef far
70#undef near
71#undef pascal
72
73#define far
74#define near
75#if defined(_ARM_)
76#define pascal
77#else
78#define pascal __stdcall
79#endif
80
81#define cdecl
82#ifndef CDECL
83#define CDECL
84#endif
85
86#ifndef CALLBACK
87#if defined(_ARM_)
88#define CALLBACK
89#else
90#define CALLBACK __stdcall
91#endif
92#endif
93
94#ifndef WINAPI
95#if defined(_ARM_)
96#define WINAPI
97#else
98#define WINAPI __stdcall
99#endif
100#endif
101
102#define WINAPIV __cdecl
103#define APIENTRY WINAPI
104#if defined(_ARM_)
105#define APIPRIVATE
106#define PASCAL
107#else
108#define APIPRIVATE __stdcall
109#define PASCAL __stdcall
110#endif
111
112#ifndef WINAPI_INLINE
113#define WINAPI_INLINE WINAPI
114#endif
115
116#undef FAR
117#undef NEAR
118#define FAR
119#define NEAR
120
121#ifndef CONST
122#define CONST const
123#endif
124
125#ifndef _DEF_WINBOOL_
126#define _DEF_WINBOOL_
127typedef int WINBOOL;
128#pragma push_macro("BOOL")
129#undef BOOL
130#if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU) && !defined(_NO_BOOL_TYPEDEF)
131 typedef int BOOL;
132#endif
133#define BOOL WINBOOL
134typedef BOOL *PBOOL;
135typedef BOOL *LPBOOL;
136#pragma pop_macro("BOOL")
137#endif /* _DEF_WINBOOL_ */
138
139 typedef unsigned char BYTE;
140 typedef unsigned short WORD;
141 typedef unsigned __LONG32 DWORD;
142 typedef float FLOAT;
143 typedef FLOAT *PFLOAT;
144 typedef BYTE *PBYTE;
145 typedef BYTE *LPBYTE;
146 typedef int *PINT;
147 typedef int *LPINT;
148 typedef WORD *PWORD;
149 typedef WORD *LPWORD;
150 typedef __LONG32 *LPLONG;
151 typedef DWORD *PDWORD;
152 typedef DWORD *LPDWORD;
153 typedef void *LPVOID;
154#ifndef _LPCVOID_DEFINED
155#define _LPCVOID_DEFINED
156 typedef CONST void *LPCVOID;
157#endif
158 typedef int INT;
159 typedef unsigned int UINT;
160 typedef unsigned int *PUINT;
161
162#ifndef NT_INCLUDED
163#include <winnt.h>
164#endif
165
166 typedef UINT_PTR WPARAM;
167 typedef LONG_PTR LPARAM;
168 typedef LONG_PTR LRESULT;
169
170#ifndef __cplusplus
171#ifndef NOMINMAX
172#ifndef max
173#define max(a, b) (((a) > (b)) ? (a) : (b))
174#endif
175
176#ifndef min
177#define min(a, b) (((a) < (b)) ? (a) : (b))
178#endif
179#endif
180#endif
181
182#define MAKEWORD(a,b) ((WORD) (((BYTE) (((DWORD_PTR) (a)) & 0xff)) | ((WORD) ((BYTE) (((DWORD_PTR) (b)) & 0xff))) << 8))
183#define MAKELONG(a, b) ((LONG) (((WORD) (((DWORD_PTR) (a)) & 0xffff)) | ((DWORD) ((WORD) (((DWORD_PTR) (b)) & 0xffff))) << 16))
184#define LOWORD(l) ((WORD) (((DWORD_PTR) (l)) & 0xffff))
185#define HIWORD(l) ((WORD) ((((DWORD_PTR) (l)) >> 16) & 0xffff))
186#define LOBYTE(w) ((BYTE) (((DWORD_PTR) (w)) & 0xff))
187#define HIBYTE(w) ((BYTE) ((((DWORD_PTR) (w)) >> 8) & 0xff))
188
189 typedef HANDLE *SPHANDLE;
190 typedef HANDLE *LPHANDLE;
191 typedef HANDLE HGLOBAL;
192 typedef HANDLE HLOCAL;
193 typedef HANDLE GLOBALHANDLE;
194 typedef HANDLE LOCALHANDLE;
195#ifdef _WIN64
196 typedef INT_PTR (WINAPI *FARPROC) ();
197 typedef INT_PTR (WINAPI *NEARPROC) ();
198 typedef INT_PTR (WINAPI *PROC) ();
199#else
200 typedef int (WINAPI *FARPROC) ();
201 typedef int (WINAPI *NEARPROC) ();
202 typedef int (WINAPI *PROC) ();
203#endif
204
205 typedef WORD ATOM;
206
207 typedef int HFILE;
208 DECLARE_HANDLE (HINSTANCE);
209 DECLARE_HANDLE (HKEY);
210 typedef HKEY *PHKEY;
211 DECLARE_HANDLE (HKL);
212 DECLARE_HANDLE (HLSURF);
213 DECLARE_HANDLE (HMETAFILE);
214 typedef HINSTANCE HMODULE;
215 DECLARE_HANDLE (HRGN);
216 DECLARE_HANDLE (HRSRC);
217 DECLARE_HANDLE (HSPRITE);
218 DECLARE_HANDLE (HSTR);
219 DECLARE_HANDLE (HTASK);
220 DECLARE_HANDLE (HWINSTA);
221
222 typedef struct _FILETIME {
223 DWORD dwLowDateTime;
224 DWORD dwHighDateTime;
225 } FILETIME,*PFILETIME,*LPFILETIME;
226#define _FILETIME_
227
228#ifdef __cplusplus
229}
230#endif
231
232#endif
233#endif
Note: See TracBrowser for help on using the repository browser.