* m4/stdalign.m4 (gl_ALIGNASOF): In C mode, prefer __builtin_offsetof
over offsetof when possible, since __builtin_offsetof works also when
<stddef.h> has not been fully included yet.
+2023-01-24 Bruno Haible <bruno@clisp.org>
+
+ alignasof, stdalign: Fix a compilation error on FreeBSD 12.0.
+ * m4/stdalign.m4 (gl_ALIGNASOF): In C mode, prefer __builtin_offsetof
+ over offsetof when possible, since __builtin_offsetof works also when
+ <stddef.h> has not been fully included yet.
+
2023-01-22 Bruno Haible <bruno@clisp.org>
doc: Update list of target platforms.
# define _GL_STDALIGN_NEEDS_STDDEF 1
# endif
# else
-# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
-# define _GL_STDALIGN_NEEDS_STDDEF 1
+# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
+# define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+# else
+# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
# endif
# endif
# if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))