* lib/stdalign.in.h (_Alignas): Treat clang like GCC.
* lib/stddef.in.h (_GL_STDDEF_ALIGNAS): Likewise.
+2020-08-09 Bruno Haible <bruno@clisp.org>
+
+ Use attribute __aligned__ with clang.
+ * lib/stdalign.in.h (_Alignas): Treat clang like GCC.
+ * lib/stddef.in.h (_GL_STDDEF_ALIGNAS): Likewise.
+
2020-08-09 Bruno Haible <bruno@clisp.org>
Use __alignof__ with clang.
# define _Alignas(a) alignas (a)
# elif ((defined __APPLE__ && defined __MACH__ \
? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
- : __GNUC__ && !defined __ibmxl__) \
- || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ : __GNUC__ && !defined __ibmxl__) \
+ || (4 <= __clang_major__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
|| __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
# define _Alignas(a) __attribute__ ((__aligned__ (a)))
# elif 1300 <= _MSC_VER
and the C11 standard allows this. Work around this problem by
using __alignof__ (which returns 8 for double) rather than _Alignof
(which returns 4), and align each union member accordingly. */
-# ifdef __GNUC__
+# if defined __GNUC__ || (__clang_major__ >= 4)
# define _GL_STDDEF_ALIGNAS(type) \
__attribute__ ((__aligned__ (__alignof__ (type))))
# else