summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2020-03-01 15:08:16 +0000
committerkamil <kamil@NetBSD.org>2020-03-01 15:08:16 +0000
commitbacd14de785075a92ce6b7080a2bbe642f75d91e (patch)
treec23fbc082b48fb9f7dd82e2741094d31cc2a9456 /include
parenta1a677db9e3d6d970d6a55ba306ad2c96f487e89 (diff)
Expose max_align_t to C99/C++
max_align_t does not depend on any pre-C99 or !C++ language feature. This structure is in use in 3rd party essential C++ code as an extension for older language revisions and in gnu99 code in the NetBSD distribution (RTLD's build rules define -std=gnu11 just for exposing this struct). Exposing max_align_t from the central NetBSD header avoid duplicate definition in 3rd party code that could differ and produce ABI mismatched binaries between -std= revisions. This problem does not exist on OSs like Linux as they get this namespace visibility defined inside LLVM or GNU toolchain headers. NetBSD ships with its own stddef.h, rather than relying on a toolchain and its internal extensions.
Diffstat (limited to 'include')
-rw-r--r--include/stddef.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/stddef.h b/include/stddef.h
index 1899815ec70..962770aecb8 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stddef.h,v 1.20 2016/03/20 16:26:06 christos Exp $ */
+/* $NetBSD: stddef.h,v 1.21 2020/03/01 15:08:16 kamil Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -67,7 +67,8 @@ typedef _BSD_WCHAR_T_ wchar_t;
(&reinterpret_cast<const volatile char &>(static_cast<type *>(0)->member))))
#endif
-#if (__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
+#if (__STDC_VERSION__ - 0) > 199901L || defined(__cplusplus)
+/* Introduced in C99/C++11, as an extension exposed to C99/C++98 */
typedef union {
void *_v;
long double _ld;