File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 4
4
/* Python API mandates Python.h is included *first* */
5
5
#include " Python.h"
6
6
7
- #define PNG_SKIP_SETJMP_CHECK
8
- #include < png.h>
9
-
10
7
#include " ft2font.h"
11
8
#include " _image.h"
12
9
#include " _backend_agg.h"
Original file line number Diff line number Diff line change
1
+
2
+ /* For linux, png.h must be imported before Python.h because
3
+ png.h needs to be the one to define setjmp.
4
+ Undefining _POSIX_C_SOURCE and _XOPEN_SOURCE stops a couple
5
+ of harmless warnings.
6
+ */
7
+
8
+ #ifdef __linux__
9
+ # include < png.h>
10
+ # ifdef _POSIX_C_SOURCE
11
+ # undef _POSIX_C_SOURCE
12
+ # endif
13
+ # ifdef _XOPEN_SOURCE
14
+ # undef _XOPEN_SOURCE
15
+ # endif
16
+ # include " Python.h"
17
+ #else
18
+
1
19
/* Python API mandates Python.h is included *first* */
2
- #include " Python.h"
20
+ # include " Python.h"
3
21
4
- #define PNG_SKIP_SETJMP_CHECK
5
- #include < png.h >
22
+ # include < png.h >
23
+ #endif
6
24
7
25
// TODO: Un CXX-ify this module
8
26
#include " CXX/Extensions.hxx"
You can’t perform that action at this time.
0 commit comments