5 /* Any one of these symbols __need_* means that GNU libc
6 wants us just to define one data type. So don't define
7 the symbols that indicate this file's entire job has been done. */
8 #if (!defined(__need_wchar_t) && !defined(__need_size_t) \
9 && !defined(__need_ptrdiff_t) && !defined(__need_NULL))
12 /* snaroff@next.com says the NeXT needs this. */
13 #define _ANSI_STDDEF_H
16 #ifndef __sys_stdtypes_h
17 /* This avoids lossage on SunOS but only if stdtypes.h comes first.
18 There's no way to win with the other order! Sun lossage. */
20 /* On 4.3bsd-net2, make sure ansi.h is included, so we have
21 one less case to deal with in the following. */
22 #if defined (__BSD_NET2__) || defined (____386BSD____)
23 #include <machine/ansi.h>
26 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
27 defined if the corresponding type is *not* defined. */
38 /* Undef _FOO_T_ if we are supposed to define foo_t. */
39 #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
42 #if defined (__need_size_t) || defined (_STDDEF_H_)
45 #if defined (__need_wchar_t) || defined (_STDDEF_H_)
50 /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
52 #if defined (__sequent__) && defined (_PTRDIFF_T_)
56 /* In case nobody has defined these types, but we aren't running under
57 GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
58 __WCHAR_TYPE__ have reasonable values. This can happen if the
59 parts of GCC is compiled by an older compiler, that actually
60 include gstddef.h, such as collect2. */
62 /* Signed type of difference of two pointers. */
64 /* Define this type if we are doing the whole job,
65 or if we want this type in particular. */
66 #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
67 #ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
72 #ifndef ___int_ptrdiff_t_h
73 #ifndef _GCC_PTRDIFF_T
79 #define ___int_ptrdiff_t_h
80 #define _GCC_PTRDIFF_T
81 #ifndef __PTRDIFF_TYPE__
82 #define __PTRDIFF_TYPE__ long int
84 typedef __PTRDIFF_TYPE__ ptrdiff_t;
85 #endif /* _GCC_PTRDIFF_T */
86 #endif /* ___int_ptrdiff_t_h */
87 #endif /* _PTRDIFF_T_ */
88 #endif /* __PTRDIFF_T */
89 #endif /* _T_PTRDIFF */
90 #endif /* _T_PTRDIFF_ */
91 #endif /* _PTRDIFF_T */
93 /* If this symbol has done its job, get rid of it. */
94 #undef __need_ptrdiff_t
96 #endif /* _STDDEF_H or __need_ptrdiff_t. */
98 /* Unsigned type of `sizeof' something. */
100 /* Define this type if we are doing the whole job,
101 or if we want this type in particular. */
102 #if defined (_STDDEF_H) || defined (__need_size_t)
103 #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
104 #ifndef _SYS_SIZE_T_H
109 #ifndef ___int_size_t_h
113 #define _SYS_SIZE_T_H
118 #define ___int_size_t_h
121 #ifndef __SIZE_TYPE__
122 #define __SIZE_TYPE__ long unsigned int
124 #if !(defined (__GNUG__) && defined (size_t))
125 typedef __SIZE_TYPE__ size_t;
126 #endif /* !(defined (__GNUG__) && defined (size_t)) */
128 #endif /* _GCC_SIZE_T */
129 #endif /* ___int_size_t_h */
130 #endif /* _SIZE_T_ */
131 #endif /* __SIZE_T */
133 #endif /* _T_SIZE_ */
134 #endif /* _SYS_SIZE_T_H */
137 #endif /* _STDDEF_H or __need_size_t. */
140 /* Wide character type.
141 Locale-writers should change this as necessary to
142 be big enough to hold unique values not between 0 and 127,
143 and not (wchar_t) -1, for each defined multibyte character. */
145 /* Define this type if we are doing the whole job,
146 or if we want this type in particular. */
147 #if defined (_STDDEF_H) || defined (__need_wchar_t)
153 #ifndef ___int_wchar_t_h
160 #define ___int_wchar_t_h
162 #ifndef __WCHAR_TYPE__
163 #define __WCHAR_TYPE__ int
166 /* In C++, wchar_t is a distinct basic type,
167 and we can expect __wchar_t to be defined by cc1plus. */
168 typedef __wchar_t wchar_t;
170 /* In C, cpp tells us which type to make an alias for. */
171 typedef __WCHAR_TYPE__ wchar_t;
180 #undef __need_wchar_t
181 #endif /* _STDDEF_H or __need_wchar_t. */
183 /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
184 are already defined. */
186 #ifdef _GCC_PTRDIFF_T_
195 #endif /* _ANSI_H_ */
197 #endif /* __sys_stdtypes_h */
199 /* A null pointer constant. */
201 #if defined (_STDDEF_H) || defined (__need_NULL)
202 #undef NULL /* in case <stdio.h> has defined it. */
203 #define NULL ((void *)0)
204 #endif /* NULL not defined and <stddef.h> or need NULL. */
209 /* Offset of member MEMBER in a struct of type TYPE. */
211 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
213 #endif /* _STDDEF_H was defined this time */
215 #endif /* _ANSI_STDDEF_H was not defined before */
216 #endif /* _STDDEF_H_ was not defined before */
217 #endif /* _STDDEF_H was not defined before */