+/**
+ * @file windef.h
+ * @copy 2012 MinGW.org project
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
#ifndef _WINDEF_H
#define _WINDEF_H
-#if __GNUC__ >=3
#pragma GCC system_header
-#endif
+#include <_mingw.h>
#ifdef __cplusplus
extern "C" {
* the windef.h header.
*/
#endif
+
#ifndef _WIN32_WINNT
#define _WIN32_WINNT WINVER
/*
* including windows.h or any other method of including the windef.h header.
*/
#endif
-#ifndef WIN32
-#define WIN32
-#endif
-#ifndef _WIN32
-#define _WIN32
-#endif
+
#define FAR
#define far
#define NEAR
#define near
+
#ifndef CONST
#define CONST const
#endif
+
#undef MAX_PATH
#define MAX_PATH 260
#ifndef NULL
+
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void*)0)
#endif
+
#endif
+
#ifndef FALSE
#define FALSE 0
#endif
+
#ifndef TRUE
#define TRUE 1
#endif
#ifndef _NO_W32_PSEUDO_MODIFIERS
#define IN
#define OUT
+
#ifndef OPTIONAL
#define OPTIONAL
#endif
-#endif
-#ifdef __GNUC__
-#ifndef _fastcall
-#define _fastcall __attribute__((fastcall))
-#endif
-#ifndef __fastcall
-#define __fastcall __attribute__((fastcall))
-#endif
-#ifndef _stdcall
-#define _stdcall __attribute__((stdcall))
-#endif
-#ifndef __stdcall
-#define __stdcall __attribute__((stdcall))
-#endif
-#ifndef _cdecl
-#define _cdecl __attribute__((cdecl))
-#endif
-#ifndef __cdecl
-#define __cdecl __attribute__((cdecl))
-#endif
-#ifndef __declspec
-#define __declspec(e) __attribute__((e))
#endif
+
#ifndef _declspec
-#define _declspec(e) __attribute__((e))
-#endif
-#else
-#define _cdecl
-#define __cdecl
+#define _declspec(e) __declspec(e)
#endif
#undef pascal
#define DECLSPEC_IMPORT __declspec(dllimport)
#define DECLSPEC_EXPORT __declspec(dllexport)
-#ifdef __GNUC__
#define DECLSPEC_NORETURN __declspec(noreturn)
#define DECLARE_STDCALL_P( type ) __stdcall type
-#elif defined(__WATCOMC__)
-#define DECLSPEC_NORETURN
-#define DECLARE_STDCALL_P( type ) type __stdcall
-#endif /* __GNUC__/__WATCOMC__ */
+
#define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
#define LOWORD(l) ((WORD)((DWORD)(l)))
#define LOBYTE(w) ((BYTE)(w))
#define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
-#ifndef __WATCOMC__
#ifndef _export
#define _export
#endif
+
#ifndef __export
#define __export
#endif
-#endif
#ifndef NOMINMAX
+
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
#endif
+
#ifndef min
#define min(a,b) ((a)<(b)?(a):(b))
#endif
+
#endif
#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
#ifndef NONAMELESSUNION
-#ifdef __GNUC__
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
#define _ANONYMOUS_UNION __extension__
#define _ANONYMOUS_STRUCT __extension__
-#else
-#if defined(__cplusplus)
-#define _ANONYMOUS_UNION __extension__
-#endif /* __cplusplus */
-#endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
-#elif defined(__WATCOMC__)
-#define _ANONYMOUS_UNION
-#define _ANONYMOUS_STRUCT
-#endif /* __GNUC__/__WATCOMC__ */
#endif /* NONAMELESSUNION */
#ifndef _ANONYMOUS_UNION
#define DUMMYUNIONNAME7 u7
#define DUMMYUNIONNAME8 u8
#else
+
#define _UNION_NAME(x)
#define DUMMYUNIONNAME
#define DUMMYUNIONNAME2
#define DUMMYUNIONNAME7
#define DUMMYUNIONNAME8
#endif
+
#ifndef _ANONYMOUS_STRUCT
#define _ANONYMOUS_STRUCT
#define _STRUCT_NAME(x) x
#define DUMMYSTRUCTNAME2 s2
#define DUMMYSTRUCTNAME3 s3
#else
+
#define _STRUCT_NAME(x)
#define DUMMYSTRUCTNAME
#define DUMMYSTRUCTNAME2
#endif
#ifndef NO_STRICT
+
#ifndef STRICT
#define STRICT 1
#endif
+
#endif
/* FIXME: This will make some code compile. The programs will most
likely crash when an exception is raised, but at least they will
compile. */
-#if defined (__GNUC__) && defined (__SEH_NOOP)
+#if defined (__SEH_NOOP)
#define __try
#define __except(x) if (0) /* don't execute handler */
#define __finally
typedef unsigned long DWORD;
typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
/* FIXME: Is there a good solution to this? */
-#ifndef XFree86Server
#ifndef __OBJC__
typedef WINBOOL BOOL;
#else
#define BOOL WINBOOL
#endif
typedef unsigned char BYTE;
-#endif /* ndef XFree86Server */
typedef BOOL *PBOOL,*LPBOOL;
typedef unsigned short WORD;
typedef float FLOAT;
typedef UINT_PTR WPARAM;
typedef LONG_PTR LPARAM;
typedef LONG_PTR LRESULT;
+
#ifndef _HRESULT_DEFINED
typedef LONG HRESULT;
#define _HRESULT_DEFINED
#endif
-#ifndef XFree86Server
+
typedef WORD ATOM;
-#endif /* XFree86Server */
typedef HANDLE HHOOK;
typedef HANDLE HGLOBAL;
typedef HANDLE HLOCAL;
#ifdef __cplusplus
}
#endif
+
#endif