1 /* -*- buffer-read-only: t -*- vi: set ro: */ 2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 3 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. 4 5 Copyright (C) 2009-2019 Free Software Foundation, Inc. 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 3, or (at your option) 10 any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, see <https://www.gnu.org/licenses/>. */ 19 20 /* Written by Eric Blake. */ 21 22 /* 23 * POSIX 2008 <stddef.h> for platforms that have issues. 24 * <http://www.opengroup.org/susv3xbd/stddef.h.html> 25 */ 26 27 #if __GNUC__ >= 3 28 @PRAGMA_SYSTEM_HEADER@ 29 #endif 30 @PRAGMA_COLUMNS@ 31 32 #if defined __need_wchar_t || defined __need_size_t \ 33 || defined __need_ptrdiff_t || defined __need_NULL \ 34 || defined __need_wint_t 35 /* Special invocation convention inside gcc header files. In 36 particular, gcc provides a version of <stddef.h> that blindly 37 redefines NULL even when __need_wint_t was defined, even though 38 wint_t is not normally provided by <stddef.h>. Hence, we must 39 remember if special invocation has ever been used to obtain wint_t, 40 in which case we need to clean up NULL yet again. */ 41 42 # if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) 43 # ifdef __need_wint_t 44 # define _GL_STDDEF_WINT_T 45 # endif 46 # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ 47 # endif 48 49 #else 50 /* Normal invocation convention. */ 51 52 # ifndef _@GUARD_PREFIX@_STDDEF_H 53 54 /* The include_next requires a split double-inclusion guard. */ 55 56 # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ 57 58 /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ 59 # if (@REPLACE_NULL@ \ 60 && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T)) 61 # undef NULL 62 # ifdef __cplusplus 63 /* ISO C++ says that the macro NULL must expand to an integer constant 64 expression, hence '((void *) 0)' is not allowed in C++. */ 65 # if __GNUG__ >= 3 66 /* GNU C++ has a __null macro that behaves like an integer ('int' or 67 'long') but has the same size as a pointer. Use that, to avoid 68 warnings. */ 69 # define NULL __null 70 # else 71 # define NULL 0L 72 # endif 73 # else 74 # define NULL ((void *) 0) 75 # endif 76 # endif 77 78 # ifndef _@GUARD_PREFIX@_STDDEF_H 79 # define _@GUARD_PREFIX@_STDDEF_H 80 81 /* Some platforms lack wchar_t. */ 82 #if !@HAVE_WCHAR_T@ 83 # define wchar_t int 84 #endif 85 86 /* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is 87 a hack in case the configure-time test was done with g++ even though 88 we are currently compiling with gcc. */ 89 #if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) 90 # if !GNULIB_defined_max_align_t 91 /* On the x86, the maximum storage alignment of double, long, etc. is 4, 92 but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, 93 and the C11 standard allows this. Work around this problem by 94 using __alignof__ (which returns 8 for double) rather than _Alignof 95 (which returns 4), and align each union member accordingly. */ 96 # ifdef __GNUC__ 97 # define _GL_STDDEF_ALIGNAS(type) \ 98 __attribute__ ((__aligned__ (__alignof__ (type)))) 99 # else 100 # define _GL_STDDEF_ALIGNAS(type) /* */ 101 # endif 102 typedef union 103 { 104 char *__p _GL_STDDEF_ALIGNAS (char *); 105 double __d _GL_STDDEF_ALIGNAS (double); 106 long double __ld _GL_STDDEF_ALIGNAS (long double); 107 long int __i _GL_STDDEF_ALIGNAS (long int); 108 } rpl_max_align_t; 109 # define max_align_t rpl_max_align_t 110 # define GNULIB_defined_max_align_t 1 111 # endif 112 #endif 113 114 # endif /* _@GUARD_PREFIX@_STDDEF_H */ 115 # endif /* _@GUARD_PREFIX@_STDDEF_H */ 116 #endif /* __need_XXX */ 117