summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-03-07 02:35:27 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-03-07 02:35:27 +0100
commit50b87487a2a859fb1958bca605f66b47ea381c30 (patch)
treed58dcf904e299b1238841a631f832ee38c0491b3 /include
downloadmetatile-50b87487a2a859fb1958bca605f66b47ea381c30.tar
metatile-50b87487a2a859fb1958bca605f66b47ea381c30.zip
Initial import.
darcs-hash:20070307013527-a5988-dc8444fae65e473dba691c38e2487cd2a3efe326
Diffstat (limited to 'include')
-rw-r--r--include/XlibExtras.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/XlibExtras.h b/include/XlibExtras.h
new file mode 100644
index 0000000..52fbeaa
--- /dev/null
+++ b/include/XlibExtras.h
@@ -0,0 +1,33 @@
+/* This file copied from the X11 package */
+
+/* -----------------------------------------------------------------------------
+ * Definitions for package `X11' which are visible in Haskell land.
+ * ---------------------------------------------------------------------------*
+ */
+
+#ifndef XLIBEXTRAS_H
+#define XLIBEXTRAS_H
+#include <stdlib.h>
+/* This doesn't always work, so we play safe below... */
+#define XUTIL_DEFINE_FUNCTIONS
+#include <X11/X.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+/* Xutil.h overrides some functions with macros.
+ * In recent versions of X this can be turned off with
+ * #define XUTIL_DEFINE_FUNCTIONS
+ * before the #include, but this doesn't work with older versions.
+ * As a workaround, we undef the macros here. Note that this is only
+ * safe for functions with return type int.
+ */
+#undef XDestroyImage
+#undef XGetPixel
+#undef XPutPixel
+#undef XSubImage
+#undef XAddPixel
+#define XK_MISCELLANY
+#define XK_LATIN1
+#include <X11/keysymdef.h>
+#endif