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

Skip to content

Commit bf6e785

Browse files
committed
Merge pull request #6628 from FrankYu/master
fix the swab bug to compile on solaris system
1 parent 8d9357e commit bf6e785

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/mplutils.h

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

21+
// Prevent multiple conflicting definitions of swab from stdlib.h and unistd.h
22+
#if defined(__sun) || defined(sun)
23+
#if defined(_XPG4)
24+
#undef _XPG4
25+
#endif
26+
#if defined(_XPG3)
27+
#undef _XPG3
28+
#endif
29+
#endif
30+
2131
#include <Python.h>
2232

2333
#if PY_MAJOR_VERSION >= 3

src/numpy_cpp.h

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

28+
// Prevent multiple conflicting definitions of swab from stdlib.h and unistd.h
29+
#if defined(__sun) || defined(sun)
30+
#if defined(_XPG4)
31+
#undef _XPG4
32+
#endif
33+
#if defined(_XPG3)
34+
#undef _XPG3
35+
#endif
36+
#endif
37+
2838
#include <Python.h>
2939
#include <numpy/ndarrayobject.h>
3040

0 commit comments

Comments
 (0)