Back to index

nagios-plugins  1.4.16
stddef.in.h
Go to the documentation of this file.
00001 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
00002 
00003    Copyright (C) 2009, 2010 Free Software Foundation, Inc.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 3, or (at your option)
00008    any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software Foundation,
00017    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 /* Written by Eric Blake.  */
00020 
00021 /*
00022  * POSIX 2008 <stddef.h> for platforms that have issues.
00023  * <http://www.opengroup.org/susv3xbd/stddef.h.html>
00024  */
00025 
00026 #if __GNUC__ >= 3
00027 @PRAGMA_SYSTEM_HEADER@
00028 #endif
00029 
00030 #if defined __need_wchar_t || defined __need_size_t  \
00031   || defined __need_ptrdiff_t || defined __need_NULL \
00032   || defined __need_wint_t
00033 /* Special invocation convention inside gcc header files.  In
00034    particular, gcc provides a version of <stddef.h> that blindly
00035    redefines NULL even when __need_wint_t was defined, even though
00036    wint_t is not normally provided by <stddef.h>.  Hence, we must
00037    remember if special invocation has ever been used to obtain wint_t,
00038    in which case we need to clean up NULL yet again.  */
00039 
00040 # if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
00041 #  ifdef __need_wint_t
00042 #   undef _GL_STDDEF_H
00043 #   define _GL_STDDEF_WINT_T
00044 #  endif
00045 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
00046 # endif
00047 
00048 #else
00049 /* Normal invocation convention.  */
00050 
00051 # ifndef _GL_STDDEF_H
00052 
00053 /* The include_next requires a split double-inclusion guard.  */
00054 
00055 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
00056 
00057 #  ifndef _GL_STDDEF_H
00058 #   define _GL_STDDEF_H
00059 
00060 /* On NetBSD 5.0, the definition of NULL lacks proper parentheses.  */
00061 #if @REPLACE_NULL@
00062 # undef NULL
00063 # ifdef __cplusplus
00064    /* ISO C++ says that the macro NULL must expand to an integer constant
00065       expression, hence '((void *) 0)' is not allowed in C++.  */
00066 #  if __GNUG__ >= 3
00067     /* GNU C++ has a __null macro that behaves like an integer ('int' or
00068        'long') but has the same size as a pointer.  Use that, to avoid
00069        warnings.  */
00070 #   define NULL __null
00071 #  else
00072 #   define NULL 0L
00073 #  endif
00074 # else
00075 #  define NULL ((void *) 0)
00076 # endif
00077 #endif
00078 
00079 /* Some platforms lack wchar_t.  */
00080 #if !@HAVE_WCHAR_T@
00081 # define wchar_t int
00082 #endif
00083 
00084 #  endif /* _GL_STDDEF_H */
00085 # endif /* _GL_STDDEF_H */
00086 #endif /* __need_XXX */