1 /* A substitute for ISO C11 <stdalign.h>. 2 3 Copyright 2011-2023 Free Software Foundation, Inc. 4 5 This file is free software: you can redistribute it and/or modify 6 it under the terms of the GNU Lesser General Public License as 7 published by the Free Software Foundation; either version 2.1 of the 8 License, or (at your option) any later version. 9 10 This file is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public License 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 17 18 /* Written by Paul Eggert and Bruno Haible. */ 19 20 /* Define two obsolescent C11 macros, assuming alignas and alignof are 21 either keywords or alignasof-defined macros. */ 22 23 #ifndef _@GUARD_PREFIX@_STDALIGN_H 24 25 #if __GNUC__ >= 3 26 @PRAGMA_SYSTEM_HEADER@ 27 #endif 28 @PRAGMA_COLUMNS@ 29 30 /* We need to include the system's <stdalign.h> when it exists, because it might 31 define 'alignof' as a macro when it's not a keyword or compiler built-in. */ 32 #if @HAVE_STDALIGN_H@ 33 /* The include_next requires a split double-inclusion guard. */ 34 # @INCLUDE_NEXT@ @NEXT_STDALIGN_H@ 35 #endif 36 37 #ifndef _@GUARD_PREFIX@_STDALIGN_H 38 #define _@GUARD_PREFIX@_STDALIGN_H 39 40 #if (defined alignas \ 41 || (defined __STDC_VERSION__ && 202311 <= __STDC_VERSION__) \ 42 || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) 43 # define __alignas_is_defined 1 44 #endif 45 46 #define __alignof_is_defined 1 47 48 #endif /* _@GUARD_PREFIX@_STDALIGN_H */ 49 #endif /* _@GUARD_PREFIX@_STDALIGN_H */