summaryrefslogtreecommitdiff
path: root/Source/cmStandardLexer.h
diff options
context:
space:
mode:
authorRafael Sadowski <rafael@sizeofvoid.org>2021-04-11 15:06:47 +0200
committerBrad King <brad.king@kitware.com>2021-04-14 11:02:29 -0400
commit317a47728360e3fec70c1eade0ffa21f535040c0 (patch)
tree9ac37f3ecc007fd2ed956760b7c06f6361792611 /Source/cmStandardLexer.h
parent9765ccfa71845caa85323613d583c67c08d1f45c (diff)
downloadcmake-317a47728360e3fec70c1eade0ffa21f535040c0.tar.gz
OpenBSD: Fix system feature definitions
Since commit f034b0f663 (CMake compilation: do not use compiler extensions, 2020-03-14, v3.18.0-rc1~494^2), some sources explicitly enable needed system APIs on some platforms using definitions like `_POSIX_C_SOURCE` and `_XOPEN_SOURCE`. Drop the definitions for OpenBSD, which provides the POSIX APIs by default.
Diffstat (limited to 'Source/cmStandardLexer.h')
-rw-r--r--Source/cmStandardLexer.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h
index 1da8c98440..b871f5fca5 100644
--- a/Source/cmStandardLexer.h
+++ b/Source/cmStandardLexer.h
@@ -7,7 +7,8 @@
// NOLINTNEXTLINE(bugprone-reserved-identifier)
# define _XOPEN_SOURCE 600
#endif
-#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32) && !defined(__sun)
+#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32) && !defined(__sun) && \
+ !defined(__OpenBSD__)
/* POSIX APIs are needed */
// NOLINTNEXTLINE(bugprone-reserved-identifier)
# define _POSIX_C_SOURCE 200809L
@@ -17,7 +18,7 @@
// NOLINTNEXTLINE(bugprone-reserved-identifier)
# define _XOPEN_SOURCE 600
#endif
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
/* For isascii */
// NOLINTNEXTLINE(bugprone-reserved-identifier)
# define _XOPEN_SOURCE 700