fix C++ incompatibility in i386 definition of max_align_t
authorRich Felker <dalias@aerifal.cx>
Thu, 11 Sep 2014 14:16:30 +0000 (10:16 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 11 Sep 2014 14:16:30 +0000 (10:16 -0400)
the C11 _Alignas keyword is not present in C++, and despite it being
in the reserved namespace and thus reasonable to support even in
non-C11 modes, compilers seem to fail to support it.

arch/i386/bits/alltypes.h.in

index a7882ed568a3697e85c8765ad9d6a4bf1e1fc172..646922b19ff2c9eb019a3df73557b9a8e523b150 100644 (file)
@@ -27,7 +27,11 @@ TYPEDEF long double float_t;
 TYPEDEF long double double_t;
 #endif
 
+#ifdef __cplusplus
+TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t;
+#else
 TYPEDEF struct { _Alignas(8) long long __ll; long double __ld; } max_align_t;
+#endif
 
 TYPEDEF long time_t;
 TYPEDEF long suseconds_t;