Import upstream version 1.28
[debian/tar] / gnu / stddef.in.h
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-2014 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 <http://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 #   undef _@GUARD_PREFIX@_STDDEF_H
45 #   define _GL_STDDEF_WINT_T
46 #  endif
47 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
48 # endif
49
50 #else
51 /* Normal invocation convention.  */
52
53 # ifndef _@GUARD_PREFIX@_STDDEF_H
54
55 /* The include_next requires a split double-inclusion guard.  */
56
57 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
58
59 #  ifndef _@GUARD_PREFIX@_STDDEF_H
60 #   define _@GUARD_PREFIX@_STDDEF_H
61
62 /* On NetBSD 5.0, the definition of NULL lacks proper parentheses.  */
63 #if @REPLACE_NULL@
64 # undef NULL
65 # ifdef __cplusplus
66    /* ISO C++ says that the macro NULL must expand to an integer constant
67       expression, hence '((void *) 0)' is not allowed in C++.  */
68 #  if __GNUG__ >= 3
69     /* GNU C++ has a __null macro that behaves like an integer ('int' or
70        'long') but has the same size as a pointer.  Use that, to avoid
71        warnings.  */
72 #   define NULL __null
73 #  else
74 #   define NULL 0L
75 #  endif
76 # else
77 #  define NULL ((void *) 0)
78 # endif
79 #endif
80
81 /* Some platforms lack wchar_t.  */
82 #if !@HAVE_WCHAR_T@
83 # define wchar_t int
84 #endif
85
86 #  endif /* _@GUARD_PREFIX@_STDDEF_H */
87 # endif /* _@GUARD_PREFIX@_STDDEF_H */
88 #endif /* __need_XXX */