From 625338d095cdbcd89fc98a07cd41db661826eeb3 Mon Sep 17 00:00:00 2001 From: mjvk <29380294+mjvk@users.noreply.github.com> Date: Thu, 26 Sep 2019 18:40:14 +0200 Subject: [PATCH] Adds XOPEN_SOURCE for PATH_MAX and POSIX 1993 for stat (#5529) * Adds XOPEN_SOURCE for PATH_MAX and POSIX 1993 for stat These are the only two required extension for compilation of flatbuffers using -std=c++11 instead of gnu++11. * Sets _XOPEN_SOURCE to 600 and enable POSIX2001 for fseeko --- src/util.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 5483cee19..b80bed250 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -16,6 +16,7 @@ // clang-format off // Dont't remove `format off`, it prevent reordering of win-includes. +#define _POSIX_C_SOURCE 200112L // For stat from stat/stat.h and fseeko() (POSIX extensions). #ifdef _WIN32 # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN @@ -31,6 +32,7 @@ # include # undef interface // This is also important because of reasons #else +# define _XOPEN_SOURCE 600 // For PATH_MAX from limits.h (SUSv2 extension) # include #endif // clang-format on