finch/libgnt/gntwm.c

changeset 31830
7d6045f46f72
parent 31294
73607ab89c6f
child 32040
d4345b8d4763
--- a/finch/libgnt/gntwm.c	Sun Jun 05 14:19:03 2011 +0000
+++ b/finch/libgnt/gntwm.c	Mon Jun 06 16:25:21 2011 +0000
@@ -24,12 +24,17 @@
 
 #ifdef USE_PYTHON
 #include <Python.h>
-#else
+#endif
+
+/* Python.h may define _GNU_SOURCE and _XOPEN_SOURCE_EXTENDED, so protect
+ * these checks with #ifndef/!defined() */
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
-#if (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+#endif
+
+#if !defined _XOPEN_SOURCE_EXTENDED && (defined(__APPLE__) || defined(__unix__)) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
 #define _XOPEN_SOURCE_EXTENDED
 #endif
-#endif
 
 #include <glib.h>
 #if GLIB_CHECK_VERSION(2,6,0)

mercurial