summaryrefslogtreecommitdiff
path: root/recipes/xorg-lib/xorg-headers-native/X11/Xwindows.h
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2010-04-16 22:24:38 -0400
committerDenys Dmytriyenko <denis@denix.org>2010-04-19 11:51:11 -0400
commitbdb5416371fd16ee698f744c33a18ef1a0f83d73 (patch)
treec2f59718554d59b5ac0a83d564e5be4f8d8ac89a /recipes/xorg-lib/xorg-headers-native/X11/Xwindows.h
parentc1993858d847ac17f4bd00655adf5655fd9d2c6c (diff)
xorg-headers-native: haven't been updated since 2006, do so now
Update the combined headers from the following packages: * xproto-7.0.16 * libx11-1.3.3 * libxau-1.0.5 * libxdmcp-1.0.3 * libxt-1.0.8 For example, GenericEvent is new since xproto-7.0.13 and prevents libx11-native from building on an X-less host. Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Diffstat (limited to 'recipes/xorg-lib/xorg-headers-native/X11/Xwindows.h')
-rw-r--r--recipes/xorg-lib/xorg-headers-native/X11/Xwindows.h49
1 files changed, 30 insertions, 19 deletions
diff --git a/recipes/xorg-lib/xorg-headers-native/X11/Xwindows.h b/recipes/xorg-lib/xorg-headers-native/X11/Xwindows.h
index 7fb9840bef..6318155e13 100644
--- a/recipes/xorg-lib/xorg-headers-native/X11/Xwindows.h
+++ b/recipes/xorg-lib/xorg-headers-native/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
-#define sleep(x) Sleep(1000*x)
+#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