<stddef.h>: Add max_align_t guards for future reference.
authorzrj <rimvydas.jasinskas@gmail.com>
Sat, 14 Jan 2017 09:39:35 +0000 (11:39 +0200)
committerzrj <zrj@dragonflybsd.org>
Sat, 14 Jan 2017 13:33:27 +0000 (15:33 +0200)
There are some confusion how this c++11 feature should be implemented.

include/stddef.h

index 23b0d53..92855e2 100644 (file)
@@ -68,10 +68,13 @@ typedef     __wchar_t       wchar_t;        /* open group, _GCC_WCHAR_T OK */
 
 #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) || \
     (defined(__cplusplus) && __cplusplus >= 201103L))
+#ifndef _MAX_ALIGN_T_DECLARED
+#define _MAX_ALIGN_T_DECLARED
 typedef struct {
        long long __max_align_nonce1 __aligned(__alignof(long long));
        long double __max_align_nonce2 __aligned(__alignof(long double));
 } max_align_t;
 #endif
+#endif
 
 #endif /* _STDDEF_H_ */