modernc.org/cc@v1.0.1/v2/headers/linux_arm/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h (about)

     1  /* Copyright (C) 1989-2016 Free Software Foundation, Inc.
     2  
     3  This file is part of GCC.
     4  
     5  GCC is free software; you can redistribute it and/or modify
     6  it under the terms of the GNU General Public License as published by
     7  the Free Software Foundation; either version 3, or (at your option)
     8  any later version.
     9  
    10  GCC 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 General Public License for more details.
    14  
    15  Under Section 7 of GPL version 3, you are granted additional
    16  permissions described in the GCC Runtime Library Exception, version
    17  3.1, as published by the Free Software Foundation.
    18  
    19  You should have received a copy of the GNU General Public License and
    20  a copy of the GCC Runtime Library Exception along with this program;
    21  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    22  <http://www.gnu.org/licenses/>.  */
    23  
    24  /*
    25   * ISO C Standard:  7.17  Common definitions  <stddef.h>
    26   */
    27  #if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
    28       && !defined(__STDDEF_H__)) \
    29      || defined(__need_wchar_t) || defined(__need_size_t) \
    30      || defined(__need_ptrdiff_t) || defined(__need_NULL) \
    31      || defined(__need_wint_t)
    32  
    33  /* Any one of these symbols __need_* means that GNU libc
    34     wants us just to define one data type.  So don't define
    35     the symbols that indicate this file's entire job has been done.  */
    36  #if (!defined(__need_wchar_t) && !defined(__need_size_t)	\
    37       && !defined(__need_ptrdiff_t) && !defined(__need_NULL)	\
    38       && !defined(__need_wint_t))
    39  #define _STDDEF_H
    40  #define _STDDEF_H_
    41  /* snaroff@next.com says the NeXT needs this.  */
    42  #define _ANSI_STDDEF_H
    43  #endif
    44  
    45  #ifndef __sys_stdtypes_h
    46  /* This avoids lossage on SunOS but only if stdtypes.h comes first.
    47     There's no way to win with the other order!  Sun lossage.  */
    48  
    49  /* On 4.3bsd-net2, make sure ansi.h is included, so we have
    50     one less case to deal with in the following.  */
    51  #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
    52  #include <machine/ansi.h>
    53  #endif
    54  /* On FreeBSD 5, machine/ansi.h does not exist anymore... */
    55  #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
    56  #include <sys/_types.h>
    57  #endif
    58  
    59  /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
    60     defined if the corresponding type is *not* defined.
    61     FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
    62     NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */
    63  #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_)  || defined(_I386_ANSI_H_)
    64  #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
    65  #define _SIZE_T
    66  #endif
    67  #if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
    68  #define _PTRDIFF_T
    69  #endif
    70  /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
    71     instead of _WCHAR_T_. */
    72  #if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
    73  #ifndef _BSD_WCHAR_T_
    74  #define _WCHAR_T
    75  #endif
    76  #endif
    77  /* Undef _FOO_T_ if we are supposed to define foo_t.  */
    78  #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
    79  #undef _PTRDIFF_T_
    80  #undef _BSD_PTRDIFF_T_
    81  #endif
    82  #if defined (__need_size_t) || defined (_STDDEF_H_)
    83  #undef _SIZE_T_
    84  #undef _BSD_SIZE_T_
    85  #endif
    86  #if defined (__need_wchar_t) || defined (_STDDEF_H_)
    87  #undef _WCHAR_T_
    88  #undef _BSD_WCHAR_T_
    89  #endif
    90  #endif				/* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */
    91  
    92  /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
    93     Just ignore it.  */
    94  #if defined (__sequent__) && defined (_PTRDIFF_T_)
    95  #undef _PTRDIFF_T_
    96  #endif
    97  
    98  /* On VxWorks, <type/vxTypesBase.h> may have defined macros like
    99     _TYPE_size_t which will typedef size_t.  fixincludes patched the
   100     vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
   101     not defined, and so that defining this macro defines _GCC_SIZE_T.
   102     If we find that the macros are still defined at this point, we must
   103     invoke them so that the type is defined as expected.  */
   104  #if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
   105  _TYPE_ptrdiff_t;
   106  #undef _TYPE_ptrdiff_t
   107  #endif
   108  #if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
   109  _TYPE_size_t;
   110  #undef _TYPE_size_t
   111  #endif
   112  #if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
   113  _TYPE_wchar_t;
   114  #undef _TYPE_wchar_t
   115  #endif
   116  
   117  /* In case nobody has defined these types, but we aren't running under
   118     GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
   119     __WCHAR_TYPE__ have reasonable values.  This can happen if the
   120     parts of GCC is compiled by an older compiler, that actually
   121     include gstddef.h, such as collect2.  */
   122  
   123  /* Signed type of difference of two pointers.  */
   124  
   125  /* Define this type if we are doing the whole job,
   126     or if we want this type in particular.  */
   127  #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
   128  #ifndef _PTRDIFF_T		/* in case <sys/types.h> has defined it. */
   129  #ifndef _T_PTRDIFF_
   130  #ifndef _T_PTRDIFF
   131  #ifndef __PTRDIFF_T
   132  #ifndef _PTRDIFF_T_
   133  #ifndef _BSD_PTRDIFF_T_
   134  #ifndef ___int_ptrdiff_t_h
   135  #ifndef _GCC_PTRDIFF_T
   136  #ifndef _PTRDIFF_T_DECLARED	/* DragonFly */
   137  #define _PTRDIFF_T
   138  #define _T_PTRDIFF_
   139  #define _T_PTRDIFF
   140  #define __PTRDIFF_T
   141  #define _PTRDIFF_T_
   142  #define _BSD_PTRDIFF_T_
   143  #define ___int_ptrdiff_t_h
   144  #define _GCC_PTRDIFF_T
   145  #define _PTRDIFF_T_DECLARED
   146  #ifndef __PTRDIFF_TYPE__
   147  #define __PTRDIFF_TYPE__ long int
   148  #endif
   149  typedef __PTRDIFF_TYPE__ ptrdiff_t;
   150  #endif				/* _PTRDIFF_T_DECLARED */
   151  #endif				/* _GCC_PTRDIFF_T */
   152  #endif				/* ___int_ptrdiff_t_h */
   153  #endif				/* _BSD_PTRDIFF_T_ */
   154  #endif				/* _PTRDIFF_T_ */
   155  #endif				/* __PTRDIFF_T */
   156  #endif				/* _T_PTRDIFF */
   157  #endif				/* _T_PTRDIFF_ */
   158  #endif				/* _PTRDIFF_T */
   159  
   160  /* If this symbol has done its job, get rid of it.  */
   161  #undef	__need_ptrdiff_t
   162  
   163  #endif				/* _STDDEF_H or __need_ptrdiff_t.  */
   164  
   165  /* Unsigned type of `sizeof' something.  */
   166  
   167  /* Define this type if we are doing the whole job,
   168     or if we want this type in particular.  */
   169  #if defined (_STDDEF_H) || defined (__need_size_t)
   170  #ifndef __size_t__		/* BeOS */
   171  #ifndef __SIZE_T__		/* Cray Unicos/Mk */
   172  #ifndef _SIZE_T			/* in case <sys/types.h> has defined it. */
   173  #ifndef _SYS_SIZE_T_H
   174  #ifndef _T_SIZE_
   175  #ifndef _T_SIZE
   176  #ifndef __SIZE_T
   177  #ifndef _SIZE_T_
   178  #ifndef _BSD_SIZE_T_
   179  #ifndef _SIZE_T_DEFINED_
   180  #ifndef _SIZE_T_DEFINED
   181  #ifndef _BSD_SIZE_T_DEFINED_	/* Darwin */
   182  #ifndef _SIZE_T_DECLARED	/* FreeBSD 5 */
   183  #ifndef ___int_size_t_h
   184  #ifndef _GCC_SIZE_T
   185  #ifndef _SIZET_
   186  #ifndef __size_t
   187  #define __size_t__		/* BeOS */
   188  #define __SIZE_T__		/* Cray Unicos/Mk */
   189  #define _SIZE_T
   190  #define _SYS_SIZE_T_H
   191  #define _T_SIZE_
   192  #define _T_SIZE
   193  #define __SIZE_T
   194  #define _SIZE_T_
   195  #define _BSD_SIZE_T_
   196  #define _SIZE_T_DEFINED_
   197  #define _SIZE_T_DEFINED
   198  #define _BSD_SIZE_T_DEFINED_	/* Darwin */
   199  #define _SIZE_T_DECLARED	/* FreeBSD 5 */
   200  #define ___int_size_t_h
   201  #define _GCC_SIZE_T
   202  #define _SIZET_
   203  #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
   204    || defined(__DragonFly__) \
   205    || defined(__FreeBSD_kernel__)
   206  /* __size_t is a typedef on FreeBSD 5, must not trash it. */
   207  #elif defined (__VMS__)
   208  /* __size_t is also a typedef on VMS.  */
   209  #else
   210  #define __size_t
   211  #endif
   212  #ifndef __SIZE_TYPE__
   213  #define __SIZE_TYPE__ long unsigned int
   214  #endif
   215  #if !(defined (__GNUG__) && defined (size_t))
   216  typedef __SIZE_TYPE__ size_t;
   217  #ifdef __BEOS__
   218  typedef long ssize_t;
   219  #endif				/* __BEOS__ */
   220  #endif				/* !(defined (__GNUG__) && defined (size_t)) */
   221  #endif				/* __size_t */
   222  #endif				/* _SIZET_ */
   223  #endif				/* _GCC_SIZE_T */
   224  #endif				/* ___int_size_t_h */
   225  #endif				/* _SIZE_T_DECLARED */
   226  #endif				/* _BSD_SIZE_T_DEFINED_ */
   227  #endif				/* _SIZE_T_DEFINED */
   228  #endif				/* _SIZE_T_DEFINED_ */
   229  #endif				/* _BSD_SIZE_T_ */
   230  #endif				/* _SIZE_T_ */
   231  #endif				/* __SIZE_T */
   232  #endif				/* _T_SIZE */
   233  #endif				/* _T_SIZE_ */
   234  #endif				/* _SYS_SIZE_T_H */
   235  #endif				/* _SIZE_T */
   236  #endif				/* __SIZE_T__ */
   237  #endif				/* __size_t__ */
   238  #undef	__need_size_t
   239  #endif				/* _STDDEF_H or __need_size_t.  */
   240  
   241  /* Wide character type.
   242     Locale-writers should change this as necessary to
   243     be big enough to hold unique values not between 0 and 127,
   244     and not (wchar_t) -1, for each defined multibyte character.  */
   245  
   246  /* Define this type if we are doing the whole job,
   247     or if we want this type in particular.  */
   248  #if defined (_STDDEF_H) || defined (__need_wchar_t)
   249  #ifndef __wchar_t__		/* BeOS */
   250  #ifndef __WCHAR_T__		/* Cray Unicos/Mk */
   251  #ifndef _WCHAR_T
   252  #ifndef _T_WCHAR_
   253  #ifndef _T_WCHAR
   254  #ifndef __WCHAR_T
   255  #ifndef _WCHAR_T_
   256  #ifndef _BSD_WCHAR_T_
   257  #ifndef _BSD_WCHAR_T_DEFINED_	/* Darwin */
   258  #ifndef _BSD_RUNE_T_DEFINED_	/* Darwin */
   259  #ifndef _WCHAR_T_DECLARED	/* FreeBSD 5 */
   260  #ifndef _WCHAR_T_DEFINED_
   261  #ifndef _WCHAR_T_DEFINED
   262  #ifndef _WCHAR_T_H
   263  #ifndef ___int_wchar_t_h
   264  #ifndef __INT_WCHAR_T_H
   265  #ifndef _GCC_WCHAR_T
   266  #define __wchar_t__		/* BeOS */
   267  #define __WCHAR_T__		/* Cray Unicos/Mk */
   268  #define _WCHAR_T
   269  #define _T_WCHAR_
   270  #define _T_WCHAR
   271  #define __WCHAR_T
   272  #define _WCHAR_T_
   273  #define _BSD_WCHAR_T_
   274  #define _WCHAR_T_DEFINED_
   275  #define _WCHAR_T_DEFINED
   276  #define _WCHAR_T_H
   277  #define ___int_wchar_t_h
   278  #define __INT_WCHAR_T_H
   279  #define _GCC_WCHAR_T
   280  #define _WCHAR_T_DECLARED
   281  
   282  /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
   283     instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
   284     symbols in the _FOO_T_ family, stays defined even after its
   285     corresponding type is defined).  If we define wchar_t, then we
   286     must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
   287     we undef _WCHAR_T_, then we must also define rune_t, since 
   288     headers like runetype.h assume that if machine/ansi.h is included,
   289     and _BSD_WCHAR_T_ is not defined, then rune_t is available.
   290     machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
   291     the same type." */
   292  #ifdef _BSD_WCHAR_T_
   293  #undef _BSD_WCHAR_T_
   294  #ifdef _BSD_RUNE_T_
   295  #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
   296  typedef _BSD_RUNE_T_ rune_t;
   297  #define _BSD_WCHAR_T_DEFINED_
   298  #define _BSD_RUNE_T_DEFINED_	/* Darwin */
   299  #if defined (__FreeBSD__) && (__FreeBSD__ < 5)
   300  /* Why is this file so hard to maintain properly?  In contrast to
   301     the comment above regarding BSD/386 1.1, on FreeBSD for as long
   302     as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
   303     redundant typedefs will occur when stdlib.h is included after this file. */
   304  #undef _BSD_RUNE_T_
   305  #endif
   306  #endif
   307  #endif
   308  #endif
   309  /* FreeBSD 5 can't be handled well using "traditional" logic above
   310     since it no longer defines _BSD_RUNE_T_ yet still desires to export
   311     rune_t in some cases... */
   312  #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
   313  #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
   314  #if __BSD_VISIBLE
   315  #ifndef _RUNE_T_DECLARED
   316  typedef __rune_t rune_t;
   317  #define _RUNE_T_DECLARED
   318  #endif
   319  #endif
   320  #endif
   321  #endif
   322  
   323  #ifndef __WCHAR_TYPE__
   324  #define __WCHAR_TYPE__ int
   325  #endif
   326  #ifndef __cplusplus
   327  typedef __WCHAR_TYPE__ wchar_t;
   328  #endif
   329  #endif
   330  #endif
   331  #endif
   332  #endif
   333  #endif
   334  #endif
   335  #endif				/* _WCHAR_T_DECLARED */
   336  #endif				/* _BSD_RUNE_T_DEFINED_ */
   337  #endif
   338  #endif
   339  #endif
   340  #endif
   341  #endif
   342  #endif
   343  #endif
   344  #endif				/* __WCHAR_T__ */
   345  #endif				/* __wchar_t__ */
   346  #undef	__need_wchar_t
   347  #endif				/* _STDDEF_H or __need_wchar_t.  */
   348  
   349  #if defined (__need_wint_t)
   350  #ifndef _WINT_T
   351  #define _WINT_T
   352  
   353  #ifndef __WINT_TYPE__
   354  #define __WINT_TYPE__ unsigned int
   355  #endif
   356  typedef __WINT_TYPE__ wint_t;
   357  #endif
   358  #undef __need_wint_t
   359  #endif
   360  
   361  /*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
   362      are already defined.  */
   363  /*  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.  */
   364  /*  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.  */
   365  #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_)
   366  /*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
   367      are probably typos and should be removed before 2.8 is released.  */
   368  #ifdef _GCC_PTRDIFF_T_
   369  #undef _PTRDIFF_T_
   370  #undef _BSD_PTRDIFF_T_
   371  #endif
   372  #ifdef _GCC_SIZE_T_
   373  #undef _SIZE_T_
   374  #undef _BSD_SIZE_T_
   375  #endif
   376  #ifdef _GCC_WCHAR_T_
   377  #undef _WCHAR_T_
   378  #undef _BSD_WCHAR_T_
   379  #endif
   380  /*  The following ones are the real ones.  */
   381  #ifdef _GCC_PTRDIFF_T
   382  #undef _PTRDIFF_T_
   383  #undef _BSD_PTRDIFF_T_
   384  #endif
   385  #ifdef _GCC_SIZE_T
   386  #undef _SIZE_T_
   387  #undef _BSD_SIZE_T_
   388  #endif
   389  #ifdef _GCC_WCHAR_T
   390  #undef _WCHAR_T_
   391  #undef _BSD_WCHAR_T_
   392  #endif
   393  #endif				/* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */
   394  
   395  #endif				/* __sys_stdtypes_h */
   396  
   397  /* A null pointer constant.  */
   398  
   399  #if defined (_STDDEF_H) || defined (__need_NULL)
   400  #undef NULL			/* in case <stdio.h> has defined it. */
   401  #ifdef __GNUG__
   402  #define NULL __null
   403  #else				/* G++ */
   404  #ifndef __cplusplus
   405  #define NULL ((void *)0)
   406  #else				/* C++ */
   407  #define NULL 0
   408  #endif				/* C++ */
   409  #endif				/* G++ */
   410  #endif				/* NULL not defined and <stddef.h> or need NULL.  */
   411  #undef	__need_NULL
   412  
   413  #ifdef _STDDEF_H
   414  
   415  /* Offset of member MEMBER in a struct of type TYPE. */
   416  #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
   417  
   418  #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
   419    || (defined(__cplusplus) && __cplusplus >= 201103L)
   420  #ifndef _GCC_MAX_ALIGN_T
   421  #define _GCC_MAX_ALIGN_T
   422  /* Type whose alignment is supported in every context and is at least
   423     as great as that of any standard type not using alignment
   424     specifiers.  */
   425  typedef struct {
   426  	long long __max_align_ll __attribute__ ((__aligned__(__alignof__(long long))));
   427  	long double __max_align_ld __attribute__ ((__aligned__(__alignof__(long double))));
   428  } max_align_t;
   429  #endif
   430  #endif				/* C11 or C++11.  */
   431  
   432  #if defined(__cplusplus) && __cplusplus >= 201103L
   433  #ifndef _GXX_NULLPTR_T
   434  #define _GXX_NULLPTR_T
   435  typedef decltype(nullptr) nullptr_t;
   436  #endif
   437  #endif				/* C++11.  */
   438  
   439  #endif				/* _STDDEF_H was defined this time */
   440  
   441  #endif				/* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
   442  				   || __need_XXX was not defined before */