6 /* Any one of these symbols __need_* means that GNU libc
7 wants us just to define one data type. So don't define
8 the symbols that indicate this file's entire job has been done. */
9 #if (!defined(__need_wchar_t) && !defined(__need_size_t) \
10 && !defined(__need_ptrdiff_t) && !defined(__need_NULL))
13 /* snaroff@next.com says the NeXT needs this. */
14 #define _ANSI_STDDEF_H
15 /* Irix 5.1 needs this. */
19 #ifndef __sys_stdtypes_h
20 /* This avoids lossage on SunOS but only if stdtypes.h comes first.
21 There's no way to win with the other order! Sun lossage. */
23 /* On 4.3bsd-net2, make sure ansi.h is included, so we have
24 one less case to deal with in the following. */
25 #if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__)
26 #include <machine/ansi.h>
29 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
30 defined if the corresponding type is *not* defined. */
38 /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
39 instead of _WCHAR_T_. */
45 /* Undef _FOO_T_ if we are supposed to define foo_t. */
46 #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
49 #if defined (__need_size_t) || defined (_STDDEF_H_)
52 #if defined (__need_wchar_t) || defined (_STDDEF_H_)
57 /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
59 #if defined (__sequent__) && defined (_PTRDIFF_T_)
63 /* In case nobody has defined these types, but we aren't running under
64 GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
65 __WCHAR_TYPE__ have reasonable values. This can happen if the
66 parts of GCC is compiled by an older compiler, that actually
67 include gstddef.h, such as collect2. */
69 /* Signed type of difference of two pointers. */
71 /* Define this type if we are doing the whole job,
72 or if we want this type in particular. */
73 #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
74 #ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
79 #ifndef ___int_ptrdiff_t_h
80 #ifndef _GCC_PTRDIFF_T
86 #define ___int_ptrdiff_t_h
87 #define _GCC_PTRDIFF_T
88 #ifndef __PTRDIFF_TYPE__
89 #define __PTRDIFF_TYPE__ long int
91 typedef __PTRDIFF_TYPE__ ptrdiff_t;
92 #endif /* _GCC_PTRDIFF_T */
93 #endif /* ___int_ptrdiff_t_h */
94 #endif /* _PTRDIFF_T_ */
95 #endif /* __PTRDIFF_T */
96 #endif /* _T_PTRDIFF */
97 #endif /* _T_PTRDIFF_ */
98 #endif /* _PTRDIFF_T */
100 /* If this symbol has done its job, get rid of it. */
101 #undef __need_ptrdiff_t
103 #endif /* _STDDEF_H or __need_ptrdiff_t. */
105 /* Unsigned type of `sizeof' something. */
107 /* Define this type if we are doing the whole job,
108 or if we want this type in particular. */
109 #if defined (_STDDEF_H) || defined (__need_size_t)
110 #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
111 #ifndef _SYS_SIZE_T_H
116 #ifndef _SIZE_T_DEFINED_
117 #ifndef ___int_size_t_h
122 #define _SYS_SIZE_T_H
127 #define _SIZE_T_DEFINED_
128 #define ___int_size_t_h
132 #ifndef __SIZE_TYPE__
133 #define __SIZE_TYPE__ long unsigned int
135 #if !(defined (__GNUG__) && defined (size_t))
136 typedef __SIZE_TYPE__ size_t;
137 #endif /* !(defined (__GNUG__) && defined (size_t)) */
138 #endif /* __size_t */
140 #endif /* _GCC_SIZE_T */
141 #endif /* ___int_size_t_h */
142 #endif /* _SIZE_T_DEFINED_ */
143 #endif /* _SIZE_T_ */
144 #endif /* __SIZE_T */
146 #endif /* _T_SIZE_ */
147 #endif /* _SYS_SIZE_T_H */
150 #endif /* _STDDEF_H or __need_size_t. */
153 /* Wide character type.
154 Locale-writers should change this as necessary to
155 be big enough to hold unique values not between 0 and 127,
156 and not (wchar_t) -1, for each defined multibyte character. */
158 /* Define this type if we are doing the whole job,
159 or if we want this type in particular. */
160 #if defined (_STDDEF_H) || defined (__need_wchar_t)
166 #ifndef _WCHAR_T_DEFINED_
168 #ifndef ___int_wchar_t_h
169 #ifndef __INT_WCHAR_T_H
176 #define _WCHAR_T_DEFINED_
178 #define ___int_wchar_t_h
179 #define __INT_WCHAR_T_H
182 /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
183 instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
184 symbols in the _FOO_T_ family, stays defined even after its
185 corresponding type is defined). If we define wchar_t, then we
186 must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
187 we undef _WCHAR_T_, then we must also define rune_t, since
188 headers like runetype.h assume that if machine/ansi.h is included,
189 and _BSD_WCHAR_T_ is not defined, then rune_t is available.
190 machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
195 #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
196 typedef _BSD_RUNE_T_ rune_t;
201 #ifndef __WCHAR_TYPE__
202 #define __WCHAR_TYPE__ int
204 typedef __WCHAR_TYPE__ wchar_t;
215 #undef __need_wchar_t
216 #endif /* _STDDEF_H or __need_wchar_t. */
218 /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
219 are already defined. */
221 /* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
222 are probably typos and should be removed before 2.7 is released. */
223 #ifdef _GCC_PTRDIFF_T_
232 /* The following ones are the real ones. */
233 #ifdef _GCC_PTRDIFF_T
242 #endif /* _ANSI_H_ */
244 #endif /* __sys_stdtypes_h */
246 /* A null pointer constant. */
248 #if defined (_STDDEF_H) || defined (__need_NULL)
249 #undef NULL /* in case <stdio.h> has defined it. */
250 #define NULL ((void *)0)
251 #endif /* NULL not defined and <stddef.h> or need NULL. */
256 /* Offset of member MEMBER in a struct of type TYPE. */
258 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
260 #endif /* _STDDEF_H was defined this time */
262 #endif /* __STDDEF_H__ was not defined before */
263 #endif /* _ANSI_STDDEF_H was not defined before */
264 #endif /* _STDDEF_H_ was not defined before */
265 #endif /* _STDDEF_H was not defined before */