From a8b41e2c68ca38b2b47f20c591042fb69a731494 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 5 Feb 2021 07:11:58 -0500 Subject: LexerParser: Do not override existing _POSIX_C_SOURCE definition In commit f034b0f663 (CMake compilation: do not use compiler extensions, 2020-03-14, v3.18.0-rc1~494^2) we explicitly defined `_POSIX_C_SOURCE` to ensure availability of POSIX APIs even when compiler extensions are not enabled. Update the code to avoid redefining `_POSIX_C_SOURCE` if it is already defined. This occurs when building our release binaries as configured in `Utilities/Release/linux`, where we define `_POSIX_C_SOURCE` explicitly on the compiler command line. --- Source/cmStandardLexer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h index e0b2116..b248b91 100644 --- a/Source/cmStandardLexer.h +++ b/Source/cmStandardLexer.h @@ -7,7 +7,7 @@ /* Needed for glibc < 2.12 */ # define _XOPEN_SOURCE 600 #endif -#if !defined(_WIN32) && !defined(__sun) +#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32) && !defined(__sun) /* POSIX APIs are needed */ # define _POSIX_C_SOURCE 200809L #endif -- cgit v0.12