+2023-01-24 Bruno Haible <bruno@clisp.org>
+
+ stdalign: Fix a compilation error on FreeBSD 12.0.
+ * lib/stdalign.in.h (_Alignof): In C mode, prefer __builtin_offsetof
+ over offsetof when possible, since __builtin_offsetof works also when
+ <stddef.h> has not been fully included yet.
+ * m4/stdalign.m4 (gl_STDALIGN_H): Likewise.
+
2023-01-22 Paul Eggert <eggert@cs.ucla.edu>
sigsegv, vma-iter: port to Solaris 10
# 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))
# 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))