diff options
author | marha <marha@users.sourceforge.net> | 2009-09-24 16:26:20 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-24 16:26:20 +0000 |
commit | 82967ab5e087a2fdfcb984f990ba117da68a5b60 (patch) | |
tree | 52ca72e09a0d1d0ecacfb51a8b0b5d1c8193449c /X11/Xwindows.h | |
parent | f02db4f3b9d748e1fd06e3ae2985b9cf1547cc7e (diff) | |
parent | 67b353c9ce039b254ba2e92cd6f842c505a8bd21 (diff) | |
download | vcxsrv-82967ab5e087a2fdfcb984f990ba117da68a5b60.tar.gz vcxsrv-82967ab5e087a2fdfcb984f990ba117da68a5b60.tar.bz2 vcxsrv-82967ab5e087a2fdfcb984f990ba117da68a5b60.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released
Diffstat (limited to 'X11/Xwindows.h')
-rw-r--r-- | X11/Xwindows.h | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/X11/Xwindows.h b/X11/Xwindows.h index 83649522c..6318155e1 100644 --- a/X11/Xwindows.h +++ b/X11/Xwindows.h @@ -1,4 +1,3 @@ -/* $Xorg$ */ /* Copyright 1996, 1998 The Open Group @@ -28,18 +27,29 @@ The Open Group. */ /* - * This header file has for sole purpose to allow to include windows.h - * without getting any name conflicts with our code. - * Conflicts come from the fact that including windows.h actually pulls - * in the whole Windows API... + * This header file has the sole purpose of allowing the inclusion of + * windows.h without getting any name conflicts with X headers code, by + * renaming the conflicting definitions from windows.h + * + * Some (non-Microsoft) versions of the Windows API headers actually avoid + * making the conflicting definitions if XFree86Server is defined, so we + * need to remember if that was defined and undefine it during including + * windows.h (so the conflicting definitions get wrapped correctly), and + * then redefine it afterwards... + * + * There doesn't seem to be a good way to wrap the min/max macros from + * windows.h, so we simply avoid defining them completely, allowing any + * pre-existing definition to stand. + * */ #undef _XFree86Server -#ifdef XFree86Server -#define _XFree86Server -#undef XFree86Server +#ifdef XFree86Server +# define _XFree86Server +# undef XFree86Server #endif +#define NOMINMAX #define BOOL wBOOL #define INT32 wINT32 #undef Status @@ -48,6 +58,7 @@ The Open Group. #define BYTE wBYTE #define FreeResource wFreeResource #include <windows.h> +#undef NOMINMAX #undef Status #define Status int #undef BYTE @@ -56,25 +67,25 @@ The Open Group. #undef ATOM #undef FreeResource #undef CreateWindowA -#undef min -#undef max #ifdef RESOURCE_H -#undef RT_FONT -#undef RT_CURSOR -#define RT_FONT ((RESTYPE)4) -#define RT_CURSOR ((RESTYPE)5) +# undef RT_FONT +# undef RT_CURSOR +# define RT_FONT ((RESTYPE)4) +# define RT_CURSOR ((RESTYPE)5) #endif +#ifndef __CYGWIN__ #define sleep(x) Sleep((x) * 1000) +#endif #if defined(WIN32) && (!defined(PATH_MAX) || PATH_MAX < 1024) -#undef PATH_MAX -#define PATH_MAX 1024 +# undef PATH_MAX +# define PATH_MAX 1024 #endif #ifdef _XFree86Server -#define XFree86Server -#undef _XFree86Server +# define XFree86Server +# undef _XFree86Server #endif |