Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 761e601

Browse files
committed
fix the swab bug to compile on solaris system
on smartos will met below error when try to build: In file included from /opt/local/include/python2.7/Python.h:44:0, from src/mplutils.h:21, from src/ft2font_wrapper.cpp:1: /usr/include/unistd.h:521:75: error: declaration of C function 'void swab(const void*, void*, ssize_t)' conflicts with In file included from /opt/local/include/python2.7/Python.h:42:0, from src/mplutils.h:21, from src/ft2font_wrapper.cpp:1: /usr/include/stdlib.h:170:13: error: previous declaration 'void swab(const char*, char*, ssize_t)' here error: command 'gcc' failed with exit status 1 Signed-off-by: Frank Yu <[email protected]>
1 parent f8ea2c5 commit 761e601

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/mplutils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ typedef unsigned __int8 uint8_t;
1818
# undef _XOPEN_SOURCE
1919
#endif
2020

21+
#if defined(__sun) || defined(sun)
22+
#if defined(_XPG4)
23+
#undef _XPG4
24+
#endif
25+
#endif
26+
2127
#include <Python.h>
2228

2329
#if PY_MAJOR_VERSION >= 3

src/numpy_cpp.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
# undef _XOPEN_SOURCE
2626
#endif
2727

28+
29+
#if defined(__sun) || defined(sun)
30+
#if defined(_XPG4)
31+
#undef _XPG4
32+
#endif
33+
#endif
34+
2835
#include <Python.h>
2936
#include <numpy/ndarrayobject.h>
3037

0 commit comments

Comments
 (0)