Преглед изворни кода

Move Python.h include into first position

Benno Evers пре 5 година
родитељ
комит
f5f8ce3d6a
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      matplotlibcpp.h

+ 4 - 2
matplotlibcpp.h

@@ -1,5 +1,9 @@
 #pragma once
 
+// Python headers must be included before any system headers, since
+// they define _POSIX_C_SOURCE
+#include <Python.h>
+
 #include <vector>
 #include <map>
 #include <array>
@@ -10,8 +14,6 @@
 #include <cstdint> // <cstdint> requires c++11 support
 #include <functional>
 
-#include <Python.h>
-
 #ifndef WITHOUT_NUMPY
 #  define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 #  include <numpy/arrayobject.h>