r173900 - C11: Provide the missing half of <stdalign.h>

Richard Smith richard-llvm at metafoo.co.uk
Tue Jan 29 22:33:54 PST 2013


Author: rsmith
Date: Wed Jan 30 00:33:54 2013
New Revision: 173900

URL: http://llvm.org/viewvc/llvm-project?rev=173900&view=rev
Log:
C11: Provide the missing half of <stdalign.h>

Modified:
    cfe/trunk/lib/Headers/stdalign.h
    cfe/trunk/test/Headers/c11.c

Modified: cfe/trunk/lib/Headers/stdalign.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdalign.h?rev=173900&r1=173899&r2=173900&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/stdalign.h (original)
+++ cfe/trunk/lib/Headers/stdalign.h Wed Jan 30 00:33:54 2013
@@ -25,6 +25,8 @@
 #define __STDALIGN_H
 
 #define alignas _Alignas
+#define alignof _Alignof
 #define __alignas_is_defined 1
+#define __alignof_is_defined 1
 
 #endif /* __STDALIGN_H */

Modified: cfe/trunk/test/Headers/c11.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/c11.c?rev=173900&r1=173899&r2=173900&view=diff
==============================================================================
--- cfe/trunk/test/Headers/c11.c (original)
+++ cfe/trunk/test/Headers/c11.c Wed Jan 30 00:33:54 2013
@@ -10,3 +10,9 @@ int g();
 noreturn int g();
 int noreturn g();
 int g();
+
+#include <stdalign.h>
+_Static_assert(__alignas_is_defined, "");
+_Static_assert(__alignof_is_defined, "");
+alignas(alignof(int)) char c[4];
+_Static_assert(__alignof(c) == 4, "");





More information about the cfe-commits mailing list