From 761e601417ef5219d2a73d7140e4bb339c4abb8f Mon Sep 17 00:00:00 2001 From: Frank Yu Date: Thu, 23 Jun 2016 12:38:31 +0800 Subject: [PATCH 1/3] 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 --- src/mplutils.h | 6 ++++++ src/numpy_cpp.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/mplutils.h b/src/mplutils.h index 8d4ae709e154..0cc96441eedb 100644 --- a/src/mplutils.h +++ b/src/mplutils.h @@ -18,6 +18,12 @@ typedef unsigned __int8 uint8_t; # undef _XOPEN_SOURCE #endif +#if defined(__sun) || defined(sun) +#if defined(_XPG4) +#undef _XPG4 +#endif +#endif + #include #if PY_MAJOR_VERSION >= 3 diff --git a/src/numpy_cpp.h b/src/numpy_cpp.h index 887ffe48aee7..a5dab01cd2b6 100644 --- a/src/numpy_cpp.h +++ b/src/numpy_cpp.h @@ -25,6 +25,13 @@ # undef _XOPEN_SOURCE #endif + +#if defined(__sun) || defined(sun) +#if defined(_XPG4) +#undef _XPG4 +#endif +#endif + #include #include From 86648651de0b8ad11cf1c1f6b8790ae3eebd16e3 Mon Sep 17 00:00:00 2001 From: Frank Yu Date: Thu, 23 Jun 2016 12:42:57 +0800 Subject: [PATCH 2/3] fix the blank space line Signed-off-by: Frank Yu --- src/numpy_cpp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/numpy_cpp.h b/src/numpy_cpp.h index a5dab01cd2b6..af18b5c9f60b 100644 --- a/src/numpy_cpp.h +++ b/src/numpy_cpp.h @@ -25,7 +25,6 @@ # undef _XOPEN_SOURCE #endif - #if defined(__sun) || defined(sun) #if defined(_XPG4) #undef _XPG4 From 8bfae27607ff05af7fddf6739918aab7bbf3f2d9 Mon Sep 17 00:00:00 2001 From: Frank Yu Date: Fri, 24 Jun 2016 06:15:27 +0000 Subject: [PATCH 3/3] fix the swab bug to compile on solaris system Signed-off-by: Frank Yu --- src/mplutils.h | 4 ++++ src/numpy_cpp.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/mplutils.h b/src/mplutils.h index 0cc96441eedb..06a05337667e 100644 --- a/src/mplutils.h +++ b/src/mplutils.h @@ -18,10 +18,14 @@ typedef unsigned __int8 uint8_t; # undef _XOPEN_SOURCE #endif +// Prevent multiple conflicting definitions of swab from stdlib.h and unistd.h #if defined(__sun) || defined(sun) #if defined(_XPG4) #undef _XPG4 #endif +#if defined(_XPG3) +#undef _XPG3 +#endif #endif #include diff --git a/src/numpy_cpp.h b/src/numpy_cpp.h index af18b5c9f60b..d68a637bc117 100644 --- a/src/numpy_cpp.h +++ b/src/numpy_cpp.h @@ -25,10 +25,14 @@ # undef _XOPEN_SOURCE #endif +// Prevent multiple conflicting definitions of swab from stdlib.h and unistd.h #if defined(__sun) || defined(sun) #if defined(_XPG4) #undef _XPG4 #endif +#if defined(_XPG3) +#undef _XPG3 +#endif #endif #include