* 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-08-21 Bruno Haible <bruno@clisp.org>
+
+ alignasof, stdalign: Fix a compilation error in C++ mode on FreeBSD 12.
+ * 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-08-21 Bruno Haible <bruno@clisp.org>
wcsstr: Relicense under LGPLv2+.
# define _Alignof(type) alignof (type)
# else
template <class __t> struct __alignof_helper { char __a; __t __b; };
-# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
+# define _Alignof(type) __builtin_offsetof (__alignof_helper<type>, __b)
+# else
+# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+# endif
# define _GL_STDALIGN_NEEDS_STDDEF 1
# endif
# else