summaryrefslogtreecommitdiff
path: root/m4/stdalign.m4
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2011-12-14 23:02:29 +0100
committerLudovic Courtès <ludo@gnu.org>2011-12-14 23:46:22 +0100
commit7f1ea859ee33383db29e38dec5802ee0f21b09bc (patch)
treeca1cdf98963ecf6108cda6298ea8d7674283980a /m4/stdalign.m4
parent1002c774e0b908b50895da9a21a4bb63d18228de (diff)
downloadguile-7f1ea859ee33383db29e38dec5802ee0f21b09bc.tar.gz
Update Gnulib to v0.0-6703-g4e0358a.
Diffstat (limited to 'm4/stdalign.m4')
-rw-r--r--m4/stdalign.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
new file mode 100644
index 000000000..2641dce51
--- /dev/null
+++ b/m4/stdalign.m4
@@ -0,0 +1,37 @@
+# Check for stdalign.h that conforms to C1x.
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Prepare for substituting <stdalign.h> if it is not supported.
+
+AC_DEFUN([gl_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);
+
+ /* 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'
+ fi
+
+ AC_SUBST([STDALIGN_H])
+ AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"])
+])