X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fstdalign.m4;h=9efafe5c5b255e1b297335f6ff307881d11af05b;hb=7ef6c64e210ac0979d7e8ac69bc5b5208c2405ab;hp=6659c9c3ecdd1e592cd0ddcdf400e9953320da5a;hpb=ba7b7388f820b620ad4f92d263f7037dd7c89bfc;p=gnulib.git diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index 6659c9c3e..9efafe5c5 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -1,6 +1,6 @@ # Check for stdalign.h that conforms to C11. -dnl Copyright 2011-2012 Free Software Foundation, Inc. +dnl Copyright 2011-2014 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. @@ -31,10 +31,12 @@ AC_DEFUN([gl_STDALIGN_H], /* Test _Alignas only on platforms where gnulib can help. */ #if \ - (__GNUC__ || __IBMC__ || __IBMCPP__ \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC \ || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER) - int alignas (8) alignas_int = 1; - char test_alignas[_Alignof (alignas_int) == 8 ? 1 : -1]; + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; #endif ]])], [gl_cv_header_working_stdalign_h=yes],