From f92235ea521a3ace7ec6aa16629b127b21057d20 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 11 Apr 2023 02:52:16 +0200 Subject: [PATCH] alignasof: Ensure a correct _Alignas (regression 2023-01-15). * m4/stdalign.m4 (gl_ALIGNASOF): Define _Alignas also when exists. --- ChangeLog | 6 ++++++ m4/stdalign.m4 | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89571c2e25..c9962a09b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-04-10 Bruno Haible + + alignasof: Ensure a correct _Alignas (regression 2023-01-15). + * m4/stdalign.m4 (gl_ALIGNASOF): Define _Alignas also when + exists. + 2023-04-10 Paul Eggert doc: update list of year2038 platforms diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index f49cf8ec16..1a236d66d2 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -151,22 +151,22 @@ AC_DEFUN([gl_ALIGNASOF], - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). */ -# if !HAVE_STDALIGN_H -# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 -# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER) -# define _Alignas(a) alignas (a) -# elif (!defined __attribute__ \ - && ((defined __APPLE__ && defined __MACH__ \ - ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - : __GNUC__ && !defined __ibmxl__) \ - || (4 <= __clang_major__) \ - || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ - || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) -# define _Alignas(a) __attribute__ ((__aligned__ (a))) -# elif 1300 <= _MSC_VER -# define _Alignas(a) __declspec (align (a)) -# endif +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER) +# define _Alignas(a) alignas (a) +# elif (!defined __attribute__ \ + && ((defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__ && !defined __ibmxl__) \ + || (4 <= __clang_major__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) +# define _Alignas(a) __attribute__ ((__aligned__ (a))) +# elif 1300 <= _MSC_VER +# define _Alignas(a) __declspec (align (a)) # endif +# endif +# if !HAVE_STDALIGN_H # if ((defined _Alignas \ && !(defined __cplusplus \ && (201103 <= __cplusplus || defined _MSC_VER))) \ -- 2.39.5