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. */
39 #ifndef __need_ptrdiff_t
45 /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
47 #if defined (__sequent__) && defined (_PTRDIFF_T_)
51 /* In case nobody has defined these types, but we aren't running under
52 GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
53 __WCHAR_TYPE__ have reasonable values. This can happen if the
54 parts of GCC is compiled by an older compiler, that actually
55 include gstddef.h, such as collect2. */
57 /* Signed type of difference of two pointers. */
59 /* Define this type if we are doing the whole job,
60 or if we want this type in particular. */
61 #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
62 #ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
67 #ifndef ___int_ptrdiff_t_h
68 #ifndef _GCC_PTRDIFF_T
74 #define ___int_ptrdiff_t_h
75 #define _GCC_PTRDIFF_T
76 #ifndef __PTRDIFF_TYPE__
77 #define __PTRDIFF_TYPE__ long int
79 typedef __PTRDIFF_TYPE__ ptrdiff_t;
80 #endif /* _GCC_PTRDIFF_T */
81 #endif /* ___int_ptrdiff_t_h */
82 #endif /* _PTRDIFF_T_ */
83 #endif /* __PTRDIFF_T */
84 #endif /* _T_PTRDIFF */
85 #endif /* _T_PTRDIFF_ */
86 #endif /* _PTRDIFF_T */
88 /* If this symbol has done its job, get rid of it. */
89 #undef __need_ptrdiff_t
91 #endif /* _STDDEF_H or __need_ptrdiff_t. */
93 /* Unsigned type of `sizeof' something. */
95 /* Define this type if we are doing the whole job,
96 or if we want this type in particular. */
97 #if defined (_STDDEF_H) || defined (__need_size_t)
98 #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
103 #ifndef ___int_size_t_h
111 #define ___int_size_t_h
114 #ifndef __SIZE_TYPE__
115 #define __SIZE_TYPE__ long unsigned int
117 typedef __SIZE_TYPE__ size_t;
119 #endif /* _GCC_SIZE_T */
120 #endif /* ___int_size_t_h */
121 #endif /* _SIZE_T_ */
122 #endif /* __SIZE_T */
124 #endif /* _T_SIZE_ */
127 #endif /* _STDDEF_H or __need_size_t. */
130 /* Wide character type.
131 Locale-writers should change this as necessary to
132 be big enough to hold unique values not between 0 and 127,
133 and not (wchar_t) -1, for each defined multibyte character. */
135 /* Define this type if we are doing the whole job,
136 or if we want this type in particular. */
137 #if defined (_STDDEF_H) || defined (__need_wchar_t)
143 #ifndef ___int_wchar_t_h
150 #define ___int_wchar_t_h
152 #ifndef __WCHAR_TYPE__
153 #define __WCHAR_TYPE__ int
156 /* In C++, wchar_t is a distinct basic type,
157 and we can expect __wchar_t to be defined by cc1plus. */
158 typedef __wchar_t wchar_t;
160 /* In C, cpp tells us which type to make an alias for. */
161 typedef __WCHAR_TYPE__ wchar_t;
170 #undef __need_wchar_t
171 #endif /* _STDDEF_H or __need_wchar_t. */
173 /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
174 are already defined. We need not worry about the case of wanting just
175 one of these types, not on 4.3bsd-net2, because only the GNU libc
176 header files do that. */
179 #ifdef _STDDEF_H /* This is a kludge.
180 _STDDEF_H is defined when we are using the whole file,
181 undefined when obstack.h wants just ptrdiff_t. */
187 #endif /* __sys_stdtypes_h */
189 /* A null pointer constant. */
191 #if defined (_STDDEF_H) || defined (__need_NULL)
192 #undef NULL /* in case <stdio.h> has defined it. */
193 #define NULL ((void *)0)
194 #endif /* NULL not defined and <stddef.h> or need NULL. */
199 /* Offset of member MEMBER in a struct of type TYPE. */
201 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
203 #endif /* _STDDEF_H was defined this time */
205 #endif /* _ANSI_STDDEF_H was not defined before */
206 #endif /* _STDDEF_H_ was not defined before */
207 #endif /* _STDDEF_H was not defined before */