From eb72a63ccada17ea8fa0ef5fb77cdb6b45ab77e6 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Thu, 29 Jan 2015 15:02:26 +0100 Subject: [PATCH] Only define _XOPEN_SOURCE on Linux. Fixes the build on NetBSD. The comment says it's only needed on Linux, and AFAIK Linux is the only operating system that only adds symbols when it's defined; others, like NetBSD or Solaris, also hide symbols. Signed-off-by: Thomas Klausner --- mongoose.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mongoose.c b/mongoose.c index 0cacdfed..d733d41a 100644 --- a/mongoose.c +++ b/mongoose.c @@ -48,7 +48,9 @@ #define _INTEGRAL_MAX_BITS 64 // Enable _stati64() on Windows #define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005+ #undef WIN32_LEAN_AND_MEAN // Let windows.h always include winsock2.h +#ifdef __Linux__ #define _XOPEN_SOURCE 600 // For flockfile() on Linux +#endif #define __STDC_FORMAT_MACROS // wants this for C++ #define __STDC_LIMIT_MACROS // C++ wants that for INT64_MAX #ifndef _LARGEFILE_SOURCE