Revision: 8706 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8706&view=rev Author: efiring Date: 2010-09-17 02:46:04 +0000 (Fri, 17 Sep 2010)
Log Message: ----------- include Python.h first in extension code; patch by Jason Grout. This cleans up the preprocessor directives and allows compilation on Solaris. A preprocessor directive is added to keep png.h from failing on Linux because Python.h has caused setjmp.h to be included. Modified Paths: -------------- branches/v1_0_maint/CXX/WrapPython.h branches/v1_0_maint/src/_backend_agg.cpp branches/v1_0_maint/src/_image.cpp branches/v1_0_maint/src/_png.cpp Modified: branches/v1_0_maint/CXX/WrapPython.h =================================================================== --- branches/v1_0_maint/CXX/WrapPython.h 2010-09-16 16:49:27 UTC (rev 8705) +++ branches/v1_0_maint/CXX/WrapPython.h 2010-09-17 02:46:04 UTC (rev 8706) @@ -38,26 +38,12 @@ #ifndef __PyCXX_wrap_python_hxx__ #define __PyCXX_wrap_python_hxx__ +/* Python API mandates Python.h is included *first* */ +#include "Python.h" + // On some platforms we have to include time.h to get select defined #if !defined(__WIN32__) && !defined(WIN32) && !defined(_WIN32) && !defined(_WIN64) #include <sys/time.h> #endif -// Prevent multiple conflicting definitions of swab from stdlib.h and unistd.h -#if defined(__sun) || defined(sun) -#if defined(_XPG4) -#undef _XPG4 #endif -#if defined(_XPG3) -#undef _XPG3 -#endif -#endif - -// Python.h will redefine these and generate warning in the process -#undef _XOPEN_SOURCE -#undef _POSIX_C_SOURCE - -// pull in python definitions -#include <Python.h> - -#endif Modified: branches/v1_0_maint/src/_backend_agg.cpp =================================================================== --- branches/v1_0_maint/src/_backend_agg.cpp 2010-09-16 16:49:27 UTC (rev 8705) +++ branches/v1_0_maint/src/_backend_agg.cpp 2010-09-17 02:46:04 UTC (rev 8706) @@ -1,12 +1,12 @@ /* A rewrite of _backend_agg using PyCXX to handle ref counting, etc.. */ + +/* Python API mandates Python.h is included *first* */ +#include "Python.h" + +#define PNG_SKIP_SETJMP_CHECK #include <png.h> -// To remove a gcc warning -#ifdef _POSIX_C_SOURCE -#undef _POSIX_C_SOURCE -#endif - #include "ft2font.h" #include "_image.h" #include "_backend_agg.h" Modified: branches/v1_0_maint/src/_image.cpp =================================================================== --- branches/v1_0_maint/src/_image.cpp 2010-09-16 16:49:27 UTC (rev 8705) +++ branches/v1_0_maint/src/_image.cpp 2010-09-17 02:46:04 UTC (rev 8706) @@ -1,8 +1,4 @@ -// To remove a gcc warning -#ifdef _POSIX_C_SOURCE -#undef _POSIX_C_SOURCE -#endif - +/* Python API mandates Python.h is included *first* */ #include "Python.h" #include <string> Modified: branches/v1_0_maint/src/_png.cpp =================================================================== --- branches/v1_0_maint/src/_png.cpp 2010-09-16 16:49:27 UTC (rev 8705) +++ branches/v1_0_maint/src/_png.cpp 2010-09-17 02:46:04 UTC (rev 8706) @@ -1,10 +1,9 @@ +/* Python API mandates Python.h is included *first* */ +#include "Python.h" + +#define PNG_SKIP_SETJMP_CHECK #include <png.h> -// To remove a gcc warning -#ifdef _POSIX_C_SOURCE -#undef _POSIX_C_SOURCE -#endif - // TODO: Un CXX-ify this module #include "CXX/Extensions.hxx" #include "numpy/arrayobject.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins