[waffle] [PATCH 3/3] Define _XOPEN_SOURCE on non-Linux platforms too

Josh Triplett josh at joshtriplett.org
Tue Nov 27 10:43:42 PST 2012


Non-Linux platforms also respect _XOPEN_SOURCE, and require it for some
functions, such as strdup.  Define it unconditionally, rather than only
when defined(__linux__).

Signed-off-by: Josh Triplett <josh at joshtriplett.org>
---
 src/waffle/core/wcore_error_unittest.c |    4 +---
 tests/waffle_test/priv/wt_runner.c     |    4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/waffle/core/wcore_error_unittest.c b/src/waffle/core/wcore_error_unittest.c
index 086fb91..b614949 100644
--- a/src/waffle/core/wcore_error_unittest.c
+++ b/src/waffle/core/wcore_error_unittest.c
@@ -23,9 +23,7 @@
 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifdef __linux__
-#   define _XOPEN_SOURCE 600
-#endif
+#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/waffle_test/priv/wt_runner.c b/tests/waffle_test/priv/wt_runner.c
index 6b3eedf..cdec727 100644
--- a/tests/waffle_test/priv/wt_runner.c
+++ b/tests/waffle_test/priv/wt_runner.c
@@ -23,9 +23,7 @@
 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifdef __linux__
-#   define _XOPEN_SOURCE 500 // for strdup()
-#endif
+#define _XOPEN_SOURCE 500 // for strdup()
 
 #include "wt_runner.h"
 
-- 
1.7.10.4



More information about the waffle mailing list