diff finch/libgnt/gntwm.c @ 32076:4cc9c1ea0019

Fix gntwm.c compile on some platforms. Fixes #14250
author Ethan Blanton <elb@pidgin.im>
date Mon, 06 Jun 2011 16:25:21 +0000
parents a8cc50c2279f
children 14787acaf9d7
line wrap: on
line diff
--- 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)