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. */
41 /* Undef _FOO_T_ if we are supposed to define foo_t. */
42 #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
45 #if defined (__need_size_t) || defined (_STDDEF_H_)
48 #if defined (__need_wchar_t) || defined (_STDDEF_H_)
53 /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
55 #if defined (__sequent__) && defined (_PTRDIFF_T_)
59 /* In case nobody has defined these types, but we aren't running under
60 GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
61 __WCHAR_TYPE__ have reasonable values. This can happen if the
62 parts of GCC is compiled by an older compiler, that actually
63 include gstddef.h, such as collect2. */
65 /* Signed type of difference of two pointers. */
67 /* Define this type if we are doing the whole job,
68 or if we want this type in particular. */
69 #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
70 #ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
75 #ifndef ___int_ptrdiff_t_h
76 #ifndef _GCC_PTRDIFF_T
82 #define ___int_ptrdiff_t_h
83 #define _GCC_PTRDIFF_T
84 #ifndef __PTRDIFF_TYPE__
85 #define __PTRDIFF_TYPE__ long int
87 typedef __PTRDIFF_TYPE__ ptrdiff_t;
88 #endif /* _GCC_PTRDIFF_T */
89 #endif /* ___int_ptrdiff_t_h */
90 #endif /* _PTRDIFF_T_ */
91 #endif /* __PTRDIFF_T */
92 #endif /* _T_PTRDIFF */
93 #endif /* _T_PTRDIFF_ */
94 #endif /* _PTRDIFF_T */
96 /* If this symbol has done its job, get rid of it. */
97 #undef __need_ptrdiff_t
99 #endif /* _STDDEF_H or __need_ptrdiff_t. */
101 /* Unsigned type of `sizeof' something. */
103 /* Define this type if we are doing the whole job,
104 or if we want this type in particular. */
105 #if defined (_STDDEF_H) || defined (__need_size_t)
106 #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
107 #ifndef _SYS_SIZE_T_H
112 #ifndef ___int_size_t_h
117 #define _SYS_SIZE_T_H
122 #define ___int_size_t_h
126 #ifndef __SIZE_TYPE__
127 #define __SIZE_TYPE__ long unsigned int
129 #if !(defined (__GNUG__) && defined (size_t))
130 typedef __SIZE_TYPE__ size_t;
131 #endif /* !(defined (__GNUG__) && defined (size_t)) */
132 #endif /* __size_t */
134 #endif /* _GCC_SIZE_T */
135 #endif /* ___int_size_t_h */
136 #endif /* _SIZE_T_ */
137 #endif /* __SIZE_T */
139 #endif /* _T_SIZE_ */
140 #endif /* _SYS_SIZE_T_H */
143 #endif /* _STDDEF_H or __need_size_t. */
146 /* Wide character type.
147 Locale-writers should change this as necessary to
148 be big enough to hold unique values not between 0 and 127,
149 and not (wchar_t) -1, for each defined multibyte character. */
151 /* Define this type if we are doing the whole job,
152 or if we want this type in particular. */
153 #if defined (_STDDEF_H) || defined (__need_wchar_t)
160 #ifndef ___int_wchar_t_h
161 #ifndef __INT_WCHAR_T_H
169 #define ___int_wchar_t_h
170 #define __INT_WCHAR_T_H
172 #ifndef __WCHAR_TYPE__
173 #define __WCHAR_TYPE__ int
175 typedef __WCHAR_TYPE__ wchar_t;
185 #undef __need_wchar_t
186 #endif /* _STDDEF_H or __need_wchar_t. */
188 /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
189 are already defined. */
191 #ifdef _GCC_PTRDIFF_T_
200 #endif /* _ANSI_H_ */
202 #endif /* __sys_stdtypes_h */
204 /* A null pointer constant. */
206 #if defined (_STDDEF_H) || defined (__need_NULL)
207 #undef NULL /* in case <stdio.h> has defined it. */
208 #define NULL ((void *)0)
209 #endif /* NULL not defined and <stddef.h> or need NULL. */
214 /* Offset of member MEMBER in a struct of type TYPE. */
216 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
218 #endif /* _STDDEF_H was defined this time */
220 #endif /* __STDDEF_H__ was not defined before */
221 #endif /* _ANSI_STDDEF_H was not defined before */
222 #endif /* _STDDEF_H_ was not defined before */
223 #endif /* _STDDEF_H was not defined before */