From de1f0342c86fc00955f6047937fac05e56b9b54c Mon Sep 17 00:00:00 2001 From: Jason Lenz Date: Thu, 12 Nov 2020 12:12:32 -0600 Subject: [PATCH] =?UTF-8?q?Remove=20=5FPOSIX=5FC=5FSOURCE=20and=20=5FXOPEN?= =?UTF-8?q?=5FSOURCE=20definitions=20when=20compiling=20o=E2=80=A6=20(#620?= =?UTF-8?q?5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove _POSIX_C_SOURCE and _XOPEN_SOURCE definitions when compiling on OpenBSD * Only define _POSIX_C_SOURCE and _XOPEN_SOURCE for mingw/cygwin platforms * Only define POSIX statements for mingw/cygwin/qnx platforms --- src/util.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 2eda18048..3670a0193 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -17,8 +17,11 @@ // clang-format off // Dont't remove `format off`, it prevent reordering of win-includes. +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || \ + defined(__QNXNTO__) # define _POSIX_C_SOURCE 200809L # define _XOPEN_SOURCE 700L +#endif #ifdef _WIN32 # ifndef WIN32_LEAN_AND_MEAN