From 49419912f20b3cf0131a40798b162cbb596d368e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 13 Sep 2022 12:41:34 -0500 Subject: [PATCH] Port alignas definition to C23 * src/lisp.h (alignas): C23 is removing the __alignas_is_defined macro, so do not rely on it. Instead, do not define alignas if C23 or later, or if C++11 or later. --- src/lisp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lisp.h b/src/lisp.h index 2f73ba4c617..9710dbef8d2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -245,7 +245,8 @@ DEFINE_GDB_SYMBOL_BEGIN (EMACS_INT, VALMASK) DEFINE_GDB_SYMBOL_END (VALMASK) /* Ignore 'alignas' on compilers lacking it. */ -#if !defined alignas && !defined __alignas_is_defined +#if (!defined alignas && !defined __alignas_is_defined \ + && __STDC_VERSION__ < 202311 && __cplusplus < 201103) # define alignas(a) #endif -- 2.39.2