ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

stddef.h
Go to the documentation of this file.
00001 
00007 #include <crtdefs.h>
00008 
00009 #ifndef _INC_STDDEF
00010 #define _INC_STDDEF
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 #include <errno.h>
00017 
00018   _CRTIMP extern unsigned long __cdecl __threadid(void);
00019 #define _threadid (__threadid())
00020   _CRTIMP extern uintptr_t __cdecl __threadhandle(void);
00021 
00022 #ifdef __cplusplus
00023 }
00024 #endif
00025 
00026 #endif
00027 
00028 /*
00029  * ISO C Standard:  7.17  Common definitions  <stddef.h>
00030  */
00031 #if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
00032      && !defined(__STDDEF_H__)) \
00033     || defined(__need_wchar_t) || defined(__need_size_t) \
00034     || defined(__need_ptrdiff_t) || defined(__need_NULL) \
00035     || defined(__need_wint_t)
00036 
00037 /* Any one of these symbols __need_* means that GNU libc
00038    wants us just to define one data type.  So don't define
00039    the symbols that indicate this file's entire job has been done.  */
00040 #if (!defined(__need_wchar_t) && !defined(__need_size_t)    \
00041      && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \
00042      && !defined(__need_wint_t))
00043 #define _STDDEF_H
00044 #define _STDDEF_H_
00045 /* snaroff@next.com says the NeXT needs this.  */
00046 #define _ANSI_STDDEF_H
00047 /* Irix 5.1 needs this.  */
00048 #define __STDDEF_H__
00049 #endif
00050 
00051 #ifndef __sys_stdtypes_h
00052 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
00053    defined if the corresponding type is *not* defined.
00054    FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
00055 #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
00056 #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
00057 #define _SIZE_T
00058 #endif
00059 #if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
00060 #define _PTRDIFF_T
00061 #endif
00062 /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
00063    instead of _WCHAR_T_. */
00064 #if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
00065 #ifndef _BSD_WCHAR_T_
00066 #define _WCHAR_T
00067 #endif
00068 #endif
00069 /* Undef _FOO_T_ if we are supposed to define foo_t.  */
00070 #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
00071 #undef _PTRDIFF_T_
00072 #undef _BSD_PTRDIFF_T_
00073 #endif
00074 #if defined (__need_size_t) || defined (_STDDEF_H_)
00075 #undef _SIZE_T_
00076 #undef _BSD_SIZE_T_
00077 #endif
00078 #if defined (__need_wchar_t) || defined (_STDDEF_H_)
00079 #undef _WCHAR_T_
00080 #undef _BSD_WCHAR_T_
00081 #endif
00082 #endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
00083 
00084 /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
00085    Just ignore it.  */
00086 #if defined (__sequent__) && defined (_PTRDIFF_T_)
00087 #undef _PTRDIFF_T_
00088 #endif
00089 
00090 /* On VxWorks, <type/vxTypesBase.h> may have defined macros like
00091    _TYPE_size_t which will typedef size_t.  fixincludes patched the
00092    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
00093    not defined, and so that defining this macro defines _GCC_SIZE_T.
00094    If we find that the macros are still defined at this point, we must
00095    invoke them so that the type is defined as expected.  */
00096 #if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
00097 _TYPE_ptrdiff_t;
00098 #undef _TYPE_ptrdiff_t
00099 #endif
00100 #if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
00101 _TYPE_size_t;
00102 #undef _TYPE_size_t
00103 #endif
00104 #if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
00105 _TYPE_wchar_t;
00106 #undef _TYPE_wchar_t
00107 #endif
00108 
00109 /* In case nobody has defined these types, but we aren't running under
00110    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
00111    __WCHAR_TYPE__ have reasonable values.  This can happen if the
00112    parts of GCC is compiled by an older compiler, that actually
00113    include gstddef.h, such as collect2.  */
00114 
00115 /* Signed type of difference of two pointers.  */
00116 
00117 /* Define this type if we are doing the whole job,
00118    or if we want this type in particular.  */
00119 #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
00120 #ifndef _PTRDIFF_T  /* in case <sys/types.h> has defined it. */
00121 #ifndef _T_PTRDIFF_
00122 #ifndef _T_PTRDIFF
00123 #ifndef __PTRDIFF_T
00124 #ifndef _PTRDIFF_T_
00125 #ifndef _BSD_PTRDIFF_T_
00126 #ifndef ___int_ptrdiff_t_h
00127 #ifndef _GCC_PTRDIFF_T
00128 #define _PTRDIFF_T
00129 #define _T_PTRDIFF_
00130 #define _T_PTRDIFF
00131 #define __PTRDIFF_T
00132 #define _PTRDIFF_T_
00133 #define _BSD_PTRDIFF_T_
00134 #define ___int_ptrdiff_t_h
00135 #define _GCC_PTRDIFF_T
00136 #ifndef __PTRDIFF_TYPE__
00137 #ifdef _WIN64
00138 #define __PTRDIFF_TYPE__ long long int
00139 #else
00140 #define __PTRDIFF_TYPE__ long int
00141 #endif
00142 #endif
00143 #ifndef _PTRDIFF_T_DEFINED
00144 #define _PTRDIFF_T_DEFINED
00145 __MINGW_EXTENSION typedef __PTRDIFF_TYPE__ ptrdiff_t;
00146 #endif
00147 #endif /* _GCC_PTRDIFF_T */
00148 #endif /* ___int_ptrdiff_t_h */
00149 #endif /* _BSD_PTRDIFF_T_ */
00150 #endif /* _PTRDIFF_T_ */
00151 #endif /* __PTRDIFF_T */
00152 #endif /* _T_PTRDIFF */
00153 #endif /* _T_PTRDIFF_ */
00154 #endif /* _PTRDIFF_T */
00155 
00156 /* If this symbol has done its job, get rid of it.  */
00157 #undef  __need_ptrdiff_t
00158 
00159 #endif /* _STDDEF_H or __need_ptrdiff_t.  */
00160 
00161 /* Unsigned type of `sizeof' something.  */
00162 
00163 /* Define this type if we are doing the whole job,
00164    or if we want this type in particular.  */
00165 #if defined (_STDDEF_H) || defined (__need_size_t)
00166 #ifndef __size_t__  /* BeOS */
00167 #ifndef __SIZE_T__  /* Cray Unicos/Mk */
00168 #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
00169 #ifndef _SYS_SIZE_T_H
00170 #ifndef _T_SIZE_
00171 #ifndef _T_SIZE
00172 #ifndef __SIZE_T
00173 #ifndef _SIZE_T_
00174 #ifndef _BSD_SIZE_T_
00175 #ifndef _SIZE_T_DEFINED_
00176 #ifndef _SIZE_T_DEFINED
00177 #ifndef _BSD_SIZE_T_DEFINED_    /* Darwin */
00178 #ifndef _SIZE_T_DECLARED    /* FreeBSD 5 */
00179 #ifndef ___int_size_t_h
00180 #ifndef _GCC_SIZE_T
00181 #ifndef _SIZET_
00182 #ifndef __size_t
00183 #define __size_t__  /* BeOS */
00184 #define __SIZE_T__  /* Cray Unicos/Mk */
00185 #define _SIZE_T
00186 #define _SYS_SIZE_T_H
00187 #define _T_SIZE_
00188 #define _T_SIZE
00189 #define __SIZE_T
00190 #define _SIZE_T_
00191 #define _BSD_SIZE_T_
00192 #define _SIZE_T_DEFINED_
00193 #define _SIZE_T_DEFINED
00194 #define _BSD_SIZE_T_DEFINED_    /* Darwin */
00195 #define _SIZE_T_DECLARED    /* FreeBSD 5 */
00196 #define ___int_size_t_h
00197 #define _GCC_SIZE_T
00198 #define _SIZET_
00199 #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
00200 /* __size_t is a typedef on FreeBSD 5!, must not trash it. */
00201 #else
00202 #define __size_t
00203 #endif
00204 #ifndef __SIZE_TYPE__
00205 #ifdef _WIN64
00206 #define __SIZE_TYPE__ long long unsigned int
00207 #else
00208 #define __SIZE_TYPE__ long unsigned int
00209 #endif
00210 #endif
00211 #if !(defined (__GNUG__) && defined (size_t))
00212 __MINGW_EXTENSION typedef __SIZE_TYPE__ size_t;
00213 #ifdef __BEOS__
00214 typedef long ssize_t;
00215 #endif /* __BEOS__ */
00216 #endif /* !(defined (__GNUG__) && defined (size_t)) */
00217 #endif /* __size_t */
00218 #endif /* _SIZET_ */
00219 #endif /* _GCC_SIZE_T */
00220 #endif /* ___int_size_t_h */
00221 #endif /* _SIZE_T_DECLARED */
00222 #endif /* _BSD_SIZE_T_DEFINED_ */
00223 #endif /* _SIZE_T_DEFINED */
00224 #endif /* _SIZE_T_DEFINED_ */
00225 #endif /* _BSD_SIZE_T_ */
00226 #endif /* _SIZE_T_ */
00227 #endif /* __SIZE_T */
00228 #endif /* _T_SIZE */
00229 #endif /* _T_SIZE_ */
00230 #endif /* _SYS_SIZE_T_H */
00231 #endif /* _SIZE_T */
00232 #endif /* __SIZE_T__ */
00233 #endif /* __size_t__ */
00234 #undef  __need_size_t
00235 #endif /* _STDDEF_H or __need_size_t.  */
00236 
00237 
00238 /* Wide character type.
00239    Locale-writers should change this as necessary to
00240    be big enough to hold unique values not between 0 and 127,
00241    and not (wchar_t) -1, for each defined multibyte character.  */
00242 
00243 /* Define this type if we are doing the whole job,
00244    or if we want this type in particular.  */
00245 #if defined (_STDDEF_H) || defined (__need_wchar_t)
00246 #ifndef __wchar_t__ /* BeOS */
00247 #ifndef __WCHAR_T__ /* Cray Unicos/Mk */
00248 #ifndef _WCHAR_T
00249 #ifndef _T_WCHAR_
00250 #ifndef _T_WCHAR
00251 #ifndef __WCHAR_T
00252 #ifndef _WCHAR_T_
00253 #ifndef _BSD_WCHAR_T_
00254 #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
00255 #ifndef _BSD_RUNE_T_DEFINED_    /* Darwin */
00256 #ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
00257 #ifndef _WCHAR_T_DEFINED_
00258 #ifndef _WCHAR_T_DEFINED
00259 #ifndef _WCHAR_T_H
00260 #ifndef ___int_wchar_t_h
00261 #ifndef __INT_WCHAR_T_H
00262 #ifndef _GCC_WCHAR_T
00263 #define __wchar_t__ /* BeOS */
00264 #define __WCHAR_T__ /* Cray Unicos/Mk */
00265 #define _WCHAR_T
00266 #define _T_WCHAR_
00267 #define _T_WCHAR
00268 #define __WCHAR_T
00269 #define _WCHAR_T_
00270 #define _BSD_WCHAR_T_
00271 #define _WCHAR_T_DEFINED_
00272 #define _WCHAR_T_DEFINED
00273 #define _WCHAR_T_H
00274 #define ___int_wchar_t_h
00275 #define __INT_WCHAR_T_H
00276 #define _GCC_WCHAR_T
00277 #define _WCHAR_T_DECLARED
00278 
00279 /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
00280    instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
00281    symbols in the _FOO_T_ family, stays defined even after its
00282    corresponding type is defined).  If we define wchar_t, then we
00283    must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
00284    we undef _WCHAR_T_, then we must also define rune_t, since
00285    headers like runetype.h assume that if machine/ansi.h is included,
00286    and _BSD_WCHAR_T_ is not defined, then rune_t is available.
00287    machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
00288    the same type." */
00289 #ifdef _BSD_WCHAR_T_
00290 #undef _BSD_WCHAR_T_
00291 #ifdef _BSD_RUNE_T_
00292 #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
00293 typedef _BSD_RUNE_T_ rune_t;
00294 #define _BSD_WCHAR_T_DEFINED_
00295 #define _BSD_RUNE_T_DEFINED_    /* Darwin */
00296 #if defined (__FreeBSD__) && (__FreeBSD__ < 5)
00297 /* Why is this file so hard to maintain properly?  In contrast to
00298    the comment above regarding BSD/386 1.1, on FreeBSD for as long
00299    as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
00300    redundant typedefs will occur when stdlib.h is included after this file. */
00301 #undef _BSD_RUNE_T_
00302 #endif
00303 #endif
00304 #endif
00305 #endif
00306 
00307 #ifndef __WCHAR_TYPE__
00308 #define __WCHAR_TYPE__ unsigned short
00309 #endif
00310 #ifndef __cplusplus
00311 typedef __WCHAR_TYPE__ wchar_t;
00312 #endif
00313 #endif
00314 #endif
00315 #endif
00316 #endif
00317 #endif
00318 #endif
00319 #endif /* _WCHAR_T_DECLARED */
00320 #endif /* _BSD_RUNE_T_DEFINED_ */
00321 #endif
00322 #endif
00323 #endif
00324 #endif
00325 #endif
00326 #endif
00327 #endif
00328 #endif /* __WCHAR_T__ */
00329 #endif /* __wchar_t__ */
00330 #undef  __need_wchar_t
00331 #endif /* _STDDEF_H or __need_wchar_t.  */
00332 
00333 /*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
00334     are already defined.  */
00335 /*  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.  */
00336 #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
00337 /*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
00338     are probably typos and should be removed before 2.8 is released.  */
00339 #ifdef _GCC_PTRDIFF_T_
00340 #undef _PTRDIFF_T_
00341 #undef _BSD_PTRDIFF_T_
00342 #endif
00343 #ifdef _GCC_SIZE_T_
00344 #undef _SIZE_T_
00345 #undef _BSD_SIZE_T_
00346 #endif
00347 #ifdef _GCC_WCHAR_T_
00348 #undef _WCHAR_T_
00349 #undef _BSD_WCHAR_T_
00350 #endif
00351 /*  The following ones are the real ones.  */
00352 #ifdef _GCC_PTRDIFF_T
00353 #undef _PTRDIFF_T_
00354 #undef _BSD_PTRDIFF_T_
00355 #endif
00356 #ifdef _GCC_SIZE_T
00357 #undef _SIZE_T_
00358 #undef _BSD_SIZE_T_
00359 #endif
00360 #ifdef _GCC_WCHAR_T
00361 #undef _WCHAR_T_
00362 #undef _BSD_WCHAR_T_
00363 #endif
00364 #endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */
00365 
00366 #endif /* __sys_stdtypes_h */
00367 
00368 /* A null pointer constant.  */
00369 #ifndef NULL
00370 #ifdef __cplusplus
00371 #define NULL 0
00372 #else
00373 #define NULL ((void*)0)
00374 #endif
00375 #endif
00376 
00377 #ifndef offsetof
00378 
00379 /* Offset of member MEMBER in a struct of type TYPE. */
00380 #if defined(__GNUC__)
00381 #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
00382 #else
00383 #define offsetof(TYPE, MEMBER) ((size_t)&(((TYPE *)0)->MEMBER))
00384 #endif
00385 
00386 #endif /* !offsetof */
00387 
00388 #endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
00389       || __need_XXX was not defined before */

Generated on Sun May 27 2012 04:28:47 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.