+2011-12-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ stdalign: port to Clang 3.0
+ Problem reported by Simon Josefsson in
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-12/msg00005.html>.
+ * doc/posix-headers/stdalign.texi (stdalign.h): Mention Clang 3.0,
+ which has <stdalign.h> but which does not define alignof.
+ * m4/stdalign.m4 (gl_STDALIGN_H): Check for Clang 3.0's problem.
+
2011-12-01 Eric Blake <eblake@redhat.com>
mktempd: silence dd usage
@itemize
@item
This header file is missing on most circa-2011 platforms.
+@item
+Clang 3.0's @code{<stdalign.h>} does not define @code{alignof}/@code{_Alignof}.
@end itemize
Portability problems not fixed by Gnulib:
AC_DEFUN([gl_STDALIGN_H],
[
- AC_CHECK_HEADERS_ONCE([stdalign.h])
+ AC_CACHE_CHECK([for working stdalign.h],
+ [gl_cv_header_working_stdalign_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdalign.h>
+ int align_int = alignof (int) + _Alignof (double);
- if test $ac_cv_header_stdalign_h = yes; then
+ /* Test _Alignas only on platforms where gnulib can help. */
+ #if \
+ (__GNUC__ || __IBMC__ || __IBMCPP__ \
+ || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
+ int alignas (8) alignas_int = 1;
+ #endif
+ ]])],
+ [gl_cv_header_working_stdalign_h=yes],
+ [gl_cv_header_working_stdalign_h=no])])
+
+ if test $gl_cv_header_working_stdalign_h = yes; then
STDALIGN_H=''
else
STDALIGN_H='stdalign.h'