|
|
1.1 root 1: #ifndef _STDDEF_H
2: #ifndef _STDDEF_H_
1.1.1.4 root 3: #ifndef _ANSI_STDDEF_H
1.1.1.6 ! root 4: #ifndef __STDDEF_H__
1.1.1.3 root 5:
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))
1.1 root 11: #define _STDDEF_H
12: #define _STDDEF_H_
1.1.1.4 root 13: /* [email protected] says the NeXT needs this. */
14: #define _ANSI_STDDEF_H
1.1.1.6 ! root 15: /* Irix 5.1 needs this. */
! 16: #define __STDDEF_H__
1.1.1.3 root 17: #endif
1.1 root 18:
19: #ifndef __sys_stdtypes_h
1.1.1.4 root 20: /* This avoids lossage on SunOS but only if stdtypes.h comes first.
1.1 root 21: There's no way to win with the other order! Sun lossage. */
22:
1.1.1.4 root 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____)
26: #include <machine/ansi.h>
27: #endif
28:
29: /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
30: defined if the corresponding type is *not* defined. */
31: #ifdef _ANSI_H_
32: #ifndef _SIZE_T_
33: #define _SIZE_T
34: #endif
35: #ifndef _PTRDIFF_T_
36: #define _PTRDIFF_T
37: #endif
38: #ifndef _WCHAR_T_
39: #define _WCHAR_T
40: #endif
1.1.1.5 root 41: /* Undef _FOO_T_ if we are supposed to define foo_t. */
42: #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
1.1.1.4 root 43: #undef _PTRDIFF_T_
1.1.1.5 root 44: #endif
45: #if defined (__need_size_t) || defined (_STDDEF_H_)
1.1.1.4 root 46: #undef _SIZE_T_
1.1.1.5 root 47: #endif
48: #if defined (__need_wchar_t) || defined (_STDDEF_H_)
1.1.1.4 root 49: #undef _WCHAR_T_
50: #endif
51: #endif /* _ANSI_H_ */
52:
1.1.1.5 root 53: /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
54: Just ignore it. */
55: #if defined (__sequent__) && defined (_PTRDIFF_T_)
56: #undef _PTRDIFF_T_
57: #endif
58:
1.1 root 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. */
64:
65: /* Signed type of difference of two pointers. */
66:
1.1.1.4 root 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)
1.1 root 70: #ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
1.1.1.2 root 71: #ifndef _T_PTRDIFF_
1.1 root 72: #ifndef _T_PTRDIFF
73: #ifndef __PTRDIFF_T
74: #ifndef _PTRDIFF_T_
75: #ifndef ___int_ptrdiff_t_h
1.1.1.2 root 76: #ifndef _GCC_PTRDIFF_T
1.1 root 77: #define _PTRDIFF_T
1.1.1.2 root 78: #define _T_PTRDIFF_
1.1 root 79: #define _T_PTRDIFF
80: #define __PTRDIFF_T
81: #define _PTRDIFF_T_
82: #define ___int_ptrdiff_t_h
1.1.1.2 root 83: #define _GCC_PTRDIFF_T
1.1 root 84: #ifndef __PTRDIFF_TYPE__
85: #define __PTRDIFF_TYPE__ long int
86: #endif
87: typedef __PTRDIFF_TYPE__ ptrdiff_t;
1.1.1.2 root 88: #endif /* _GCC_PTRDIFF_T */
1.1 root 89: #endif /* ___int_ptrdiff_t_h */
90: #endif /* _PTRDIFF_T_ */
91: #endif /* __PTRDIFF_T */
92: #endif /* _T_PTRDIFF */
1.1.1.2 root 93: #endif /* _T_PTRDIFF_ */
1.1 root 94: #endif /* _PTRDIFF_T */
95:
1.1.1.3 root 96: /* If this symbol has done its job, get rid of it. */
97: #undef __need_ptrdiff_t
98:
1.1.1.4 root 99: #endif /* _STDDEF_H or __need_ptrdiff_t. */
100:
1.1 root 101: /* Unsigned type of `sizeof' something. */
102:
1.1.1.4 root 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)
1.1 root 106: #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
1.1.1.5 root 107: #ifndef _SYS_SIZE_T_H
1.1.1.2 root 108: #ifndef _T_SIZE_
1.1 root 109: #ifndef _T_SIZE
110: #ifndef __SIZE_T
111: #ifndef _SIZE_T_
112: #ifndef ___int_size_t_h
1.1.1.2 root 113: #ifndef _GCC_SIZE_T
1.1.1.3 root 114: #ifndef _SIZET_
1.1.1.6 ! root 115: #ifndef __size_t
1.1 root 116: #define _SIZE_T
1.1.1.5 root 117: #define _SYS_SIZE_T_H
1.1.1.2 root 118: #define _T_SIZE_
1.1 root 119: #define _T_SIZE
120: #define __SIZE_T
121: #define _SIZE_T_
122: #define ___int_size_t_h
1.1.1.2 root 123: #define _GCC_SIZE_T
1.1.1.3 root 124: #define _SIZET_
1.1.1.6 ! root 125: #define __size_t
1.1 root 126: #ifndef __SIZE_TYPE__
127: #define __SIZE_TYPE__ long unsigned int
128: #endif
1.1.1.5 root 129: #if !(defined (__GNUG__) && defined (size_t))
1.1 root 130: typedef __SIZE_TYPE__ size_t;
1.1.1.5 root 131: #endif /* !(defined (__GNUG__) && defined (size_t)) */
1.1.1.6 ! root 132: #endif /* __size_t */
1.1.1.3 root 133: #endif /* _SIZET_ */
1.1.1.2 root 134: #endif /* _GCC_SIZE_T */
1.1 root 135: #endif /* ___int_size_t_h */
136: #endif /* _SIZE_T_ */
137: #endif /* __SIZE_T */
138: #endif /* _T_SIZE */
1.1.1.2 root 139: #endif /* _T_SIZE_ */
1.1.1.5 root 140: #endif /* _SYS_SIZE_T_H */
1.1 root 141: #endif /* _SIZE_T */
1.1.1.3 root 142: #undef __need_size_t
1.1.1.4 root 143: #endif /* _STDDEF_H or __need_size_t. */
1.1 root 144:
1.1.1.3 root 145:
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. */
1.1 root 150:
1.1.1.4 root 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)
1.1 root 154: #ifndef _WCHAR_T
155: #ifndef _T_WCHAR_
156: #ifndef _T_WCHAR
157: #ifndef __WCHAR_T
158: #ifndef _WCHAR_T_
1.1.1.6 ! root 159: #ifndef _WCHAR_T_H
1.1 root 160: #ifndef ___int_wchar_t_h
1.1.1.6 ! root 161: #ifndef __INT_WCHAR_T_H
1.1.1.2 root 162: #ifndef _GCC_WCHAR_T
1.1 root 163: #define _WCHAR_T
164: #define _T_WCHAR_
165: #define _T_WCHAR
166: #define __WCHAR_T
167: #define _WCHAR_T_
1.1.1.6 ! root 168: #define _WCHAR_T_H
1.1 root 169: #define ___int_wchar_t_h
1.1.1.6 ! root 170: #define __INT_WCHAR_T_H
1.1.1.2 root 171: #define _GCC_WCHAR_T
1.1 root 172: #ifndef __WCHAR_TYPE__
173: #define __WCHAR_TYPE__ int
174: #endif
1.1.1.4 root 175: #ifdef __GNUG__
176: /* In C++, wchar_t is a distinct basic type,
177: and we can expect __wchar_t to be defined by cc1plus. */
178: typedef __wchar_t wchar_t;
179: #else
180: /* In C, cpp tells us which type to make an alias for. */
1.1 root 181: typedef __WCHAR_TYPE__ wchar_t;
1.1.1.4 root 182: #endif
1.1 root 183: #endif
184: #endif
185: #endif
186: #endif
187: #endif
188: #endif
1.1.1.2 root 189: #endif
1.1.1.6 ! root 190: #endif
! 191: #endif
1.1.1.3 root 192: #undef __need_wchar_t
1.1.1.4 root 193: #endif /* _STDDEF_H or __need_wchar_t. */
194:
195: /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
1.1.1.5 root 196: are already defined. */
1.1.1.4 root 197: #ifdef _ANSI_H_
1.1.1.5 root 198: #ifdef _GCC_PTRDIFF_T_
1.1.1.4 root 199: #undef _PTRDIFF_T_
1.1.1.5 root 200: #endif
201: #ifdef _GCC_SIZE_T_
1.1.1.4 root 202: #undef _SIZE_T_
203: #endif
1.1.1.5 root 204: #ifdef _GCC_WCHAR_T_
205: #undef _WCHAR_T_
1.1.1.4 root 206: #endif
1.1.1.5 root 207: #endif /* _ANSI_H_ */
1.1 root 208:
209: #endif /* __sys_stdtypes_h */
210:
211: /* A null pointer constant. */
212:
1.1.1.3 root 213: #if defined (_STDDEF_H) || defined (__need_NULL)
1.1 root 214: #undef NULL /* in case <stdio.h> has defined it. */
215: #define NULL ((void *)0)
1.1.1.3 root 216: #endif /* NULL not defined and <stddef.h> or need NULL. */
217: #undef __need_NULL
218:
219: #ifdef _STDDEF_H
1.1 root 220:
221: /* Offset of member MEMBER in a struct of type TYPE. */
222:
223: #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
224:
1.1.1.3 root 225: #endif /* _STDDEF_H was defined this time */
1.1.1.4 root 226:
1.1.1.6 ! root 227: #endif /* __STDDEF_H__ was not defined before */
1.1.1.4 root 228: #endif /* _ANSI_STDDEF_H was not defined before */
1.1.1.3 root 229: #endif /* _STDDEF_H_ was not defined before */
230: #endif /* _STDDEF_H was not defined before */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.