From 5749338542c15010bc277f791fd040547b2e7851 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 20 Oct 2014 15:16:29 -0400 Subject: [PATCH 1/2] Change order of includes for Ubuntu --- src/_png.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/_png.cpp b/src/_png.cpp index 0ca609e216c4..fbd4f922d8fc 100644 --- a/src/_png.cpp +++ b/src/_png.cpp @@ -10,14 +10,12 @@ of harmless warnings. */ -#include #include "numpy_cpp.h" #include "mplutils.h" #include "file_compat.h" extern "C" { -#ifdef __linux__ # include # ifdef _POSIX_C_SOURCE # undef _POSIX_C_SOURCE @@ -25,15 +23,9 @@ extern "C" { # ifdef _XOPEN_SOURCE # undef _XOPEN_SOURCE # endif -# include "Python.h" -#else - -/* Python API mandates Python.h is included *first* */ -# include "Python.h" - -# include -#endif } +# include +# include "Python.h" // As reported in [3082058] build _png.so on aix From c2c03df325f93be7d1603f781f0442951aa47b83 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 22 Oct 2014 16:18:27 -0400 Subject: [PATCH 2/2] Make png.h the absolute first thing --- src/_png.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/_png.cpp b/src/_png.cpp index fbd4f922d8fc..852a5d6e2a41 100644 --- a/src/_png.cpp +++ b/src/_png.cpp @@ -11,10 +11,6 @@ */ -#include "numpy_cpp.h" -#include "mplutils.h" -#include "file_compat.h" - extern "C" { # include # ifdef _POSIX_C_SOURCE @@ -24,6 +20,11 @@ extern "C" { # undef _XOPEN_SOURCE # endif } + +#include "numpy_cpp.h" +#include "mplutils.h" +#include "file_compat.h" + # include # include "Python.h"