summaryrefslogtreecommitdiffstats
path: root/Source/cmStandardLexer.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-03-14 16:20:49 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-03-23 09:29:58 (GMT)
commitf034b0f66338f37d4f637916cc42b9c4a4f30a32 (patch)
tree1c4fead35ad677f82cc9fd7e837c773b00bbbf61 /Source/cmStandardLexer.h
parent7099db5dd48d36e5d39ab17219278d834c8a88a7 (diff)
downloadCMake-f034b0f66338f37d4f637916cc42b9c4a4f30a32.zip
CMake-f034b0f66338f37d4f637916cc42b9c4a4f30a32.tar.gz
CMake-f034b0f66338f37d4f637916cc42b9c4a4f30a32.tar.bz2
CMake compilation: do not use compiler extensions
For now, compiler extensions are no longer activated on CMake sources. However these extensions are still used for various third parties. This MR is a partial answer to the issue #20454.
Diffstat (limited to 'Source/cmStandardLexer.h')
-rw-r--r--Source/cmStandardLexer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h
index 13f7622..55d23c1 100644
--- a/Source/cmStandardLexer.h
+++ b/Source/cmStandardLexer.h
@@ -3,6 +3,19 @@
#ifndef cmStandardLexer_h
#define cmStandardLexer_h
+#if !defined(_WIN32) && !defined(__sun)
+/* POSIX APIs are needed */
+# define _POSIX_C_SOURCE 200809L
+#endif
+#if defined(__sun) && defined(__GNUC__) && !defined(__cplusplus)
+/* C sources: for fileno and strdup */
+# define _XOPEN_SOURCE 600
+#endif
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+/* For isascii */
+# define _XOPEN_SOURCE 700
+#endif
+
#include "cmsys/Configure.h" // IWYU pragma: keep
/* Disable some warnings. */