Revision: 8708
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8708&view=rev
Author: efiring
Date: 2010-09-17 06:41:34 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
including Python.h and png.h: a second try, special case for linux
Modified Paths:
--------------
branches/v1_0_maint/src/_backend_agg.cpp
branches/v1_0_maint/src/_png.cpp
Modified: branches/v1_0_maint/src/_backend_agg.cpp
===================================================================
--- branches/v1_0_maint/src/_backend_agg.cpp 2010-09-17 02:52:46 UTC (rev 8707)
+++ branches/v1_0_maint/src/_backend_agg.cpp 2010-09-17 06:41:34 UTC (rev 8708)
@@ -4,9 +4,6 @@
/* Python API mandates Python.h is included *first* */
#include "Python.h"
-#define PNG_SKIP_SETJMP_CHECK
-#include <png.h>
-
#include "ft2font.h"
#include "_image.h"
#include "_backend_agg.h"
Modified: branches/v1_0_maint/src/_png.cpp
===================================================================
--- branches/v1_0_maint/src/_png.cpp 2010-09-17 02:52:46 UTC (rev 8707)
+++ branches/v1_0_maint/src/_png.cpp 2010-09-17 06:41:34 UTC (rev 8708)
@@ -1,8 +1,26 @@
+
+/* For linux, png.h must be imported before Python.h because
+ png.h needs to be the one to define setjmp.
+ Undefining _POSIX_C_SOURCE and _XOPEN_SOURCE stops a couple
+ of harmless warnings.
+*/
+
+#ifdef __linux__
+# include <png.h>
+# ifdef _POSIX_C_SOURCE
+# undef _POSIX_C_SOURCE
+# endif
+# ifdef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+# endif
+# include "Python.h"
+#else
+
/* Python API mandates Python.h is included *first* */
-#include "Python.h"
+# include "Python.h"
-#define PNG_SKIP_SETJMP_CHECK
-#include <png.h>
+# include <png.h>
+#endif
// TODO: Un CXX-ify this module
#include "CXX/Extensions.hxx"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|