]> Zhao Yanbai Git Server - minix.git/commitdiff
clang: apply LLVM patch r201729 19/3019/1
authorErik van der Kouwe <erik@minix3.org>
Wed, 29 Apr 2015 20:59:26 +0000 (22:59 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Mon, 29 Jun 2015 10:58:16 +0000 (10:58 +0000)
This fixes an issue when compiling with GCC 4.9.
For details, see: http://reviews.llvm.org/rL201729

Change-Id: Iaa522715798016f6edb433b01b02aa664fcb5d1c

external/bsd/llvm/dist/clang/lib/Headers/stddef.h
external/bsd/llvm/dist/clang/test/Headers/c11.c

index 6a64d6d32a8adf0d936f762423a2e0ec21f07a38..b6926942ef628066d0ce800ff22d3f3828d899dd 100644 (file)
@@ -84,6 +84,16 @@ using ::std::nullptr_t;
 #endif
 #endif
 
+#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
+typedef struct {
+  long long __clang_max_align_nonce1
+      __attribute__((__aligned__(__alignof__(long long))));
+  long double __clang_max_align_nonce2
+      __attribute__((__aligned__(__alignof__(long double))));
+} max_align_t;
+#define __CLANG_MAX_ALIGN_T_DEFINED
+#endif
+
 #define offsetof(t, d) __builtin_offsetof(t, d)
 
 #endif /* __STDDEF_H */
index 11bec195446200acfbc8d223cee512a434074be8..e335d0cebcb556fb045ed71aab5e7e4b48048260 100644 (file)
@@ -22,6 +22,10 @@ _Static_assert(__alignof(c) == 4, "");
 #define __STDC_WANT_LIB_EXT1__ 1
 #include <stddef.h>
 rsize_t x = 0;
+_Static_assert(sizeof(max_align_t) >= sizeof(long long), "");
+_Static_assert(alignof(max_align_t) >= alignof(long long), "");
+_Static_assert(sizeof(max_align_t) >= sizeof(long double), "");
+_Static_assert(alignof(max_align_t) >= alignof(long double), "");
 
 // If we are freestanding, then also check RSIZE_MAX (in a hosted implementation
 // we will use the host stdint.h, which may not yet have C11 support).