|
|
1.1 root 1: #ifndef _STDDEF_H
2: #ifndef _STDDEF_H_
1.1.1.3 ! root 3:
! 4: /* Any one of these symbols __need_* means that GNU libc
! 5: wants us just to define one data type. So don't define
! 6: the symbols that indicate this file's entire job has been done. */
! 7: #if (!defined(__need_wchar_t) && !defined(__need_size_t) \
! 8: && !defined(__need_ptrdiff_t) && !defined(__need_NULL))
1.1 root 9: #define _STDDEF_H
10: #define _STDDEF_H_
1.1.1.3 ! root 11: #endif
1.1 root 12:
13: #ifndef __sys_stdtypes_h
14: /* This avoids lossage on Sunos but only if stdtypes.h comes first.
15: There's no way to win with the other order! Sun lossage. */
16:
17: /* In case nobody has defined these types, but we aren't running under
18: GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
19: __WCHAR_TYPE__ have reasonable values. This can happen if the
20: parts of GCC is compiled by an older compiler, that actually
21: include gstddef.h, such as collect2. */
22:
23: /* Signed type of difference of two pointers. */
24:
25: #ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
1.1.1.2 root 26: #ifndef _T_PTRDIFF_
1.1 root 27: #ifndef _T_PTRDIFF
28: #ifndef __PTRDIFF_T
29: #ifndef _PTRDIFF_T_
30: #ifndef ___int_ptrdiff_t_h
1.1.1.2 root 31: #ifndef _GCC_PTRDIFF_T
1.1 root 32: #define _PTRDIFF_T
1.1.1.2 root 33: #define _T_PTRDIFF_
1.1 root 34: #define _T_PTRDIFF
35: #define __PTRDIFF_T
36: #define _PTRDIFF_T_
37: #define ___int_ptrdiff_t_h
1.1.1.2 root 38: #define _GCC_PTRDIFF_T
1.1 root 39: #ifndef __PTRDIFF_TYPE__
40: #define __PTRDIFF_TYPE__ long int
41: #endif
1.1.1.3 ! root 42: /* Define this type if we are doing the whole job,
! 43: or if we want this type in particular. */
! 44: #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
1.1 root 45: typedef __PTRDIFF_TYPE__ ptrdiff_t;
1.1.1.3 ! root 46: #endif /* <stddef.h> or __need_ptrdiff_t. */
1.1.1.2 root 47: #endif /* _GCC_PTRDIFF_T */
1.1 root 48: #endif /* ___int_ptrdiff_t_h */
49: #endif /* _PTRDIFF_T_ */
50: #endif /* __PTRDIFF_T */
51: #endif /* _T_PTRDIFF */
1.1.1.2 root 52: #endif /* _T_PTRDIFF_ */
1.1 root 53: #endif /* _PTRDIFF_T */
54:
1.1.1.3 ! root 55: /* If this symbol has done its job, get rid of it. */
! 56: #undef __need_ptrdiff_t
! 57:
1.1 root 58: /* Unsigned type of `sizeof' something. */
59:
60: #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
1.1.1.2 root 61: #ifndef _T_SIZE_
1.1 root 62: #ifndef _T_SIZE
63: #ifndef __SIZE_T
64: #ifndef _SIZE_T_
65: #ifndef ___int_size_t_h
1.1.1.2 root 66: #ifndef _GCC_SIZE_T
1.1.1.3 ! root 67: #ifndef _SIZET_
1.1 root 68: #define _SIZE_T
1.1.1.2 root 69: #define _T_SIZE_
1.1 root 70: #define _T_SIZE
71: #define __SIZE_T
72: #define _SIZE_T_
73: #define ___int_size_t_h
1.1.1.2 root 74: #define _GCC_SIZE_T
1.1.1.3 ! root 75: #define _SIZET_
1.1 root 76: #ifndef __SIZE_TYPE__
77: #define __SIZE_TYPE__ long unsigned int
78: #endif
1.1.1.3 ! root 79: /* Define this type if we are doing the whole job,
! 80: or if we want this type in particular. */
! 81: #if defined (_STDDEF_H) || defined (__need_size_t)
1.1 root 82: typedef __SIZE_TYPE__ size_t;
1.1.1.3 ! root 83: #endif /* <stddef.h> or __need_size_t. */
! 84: #endif /* _SIZET_ */
1.1.1.2 root 85: #endif /* _GCC_SIZE_T */
1.1 root 86: #endif /* ___int_size_t_h */
87: #endif /* _SIZE_T_ */
88: #endif /* __SIZE_T */
89: #endif /* _T_SIZE */
1.1.1.2 root 90: #endif /* _T_SIZE_ */
1.1 root 91: #endif /* _SIZE_T */
1.1.1.3 ! root 92: #undef __need_size_t
1.1 root 93:
1.1.1.3 ! root 94:
! 95: /* Wide character type.
! 96: Locale-writers should change this as necessary to
! 97: be big enough to hold unique values not between 0 and 127,
! 98: and not (wchar_t) -1, for each defined multibyte character. */
1.1 root 99:
100: #ifndef _WCHAR_T
101: #ifndef _T_WCHAR_
102: #ifndef _T_WCHAR
103: #ifndef __WCHAR_T
104: #ifndef _WCHAR_T_
105: #ifndef ___int_wchar_t_h
1.1.1.2 root 106: #ifndef _GCC_WCHAR_T
1.1 root 107: #define _WCHAR_T
108: #define _T_WCHAR_
109: #define _T_WCHAR
110: #define __WCHAR_T
111: #define _WCHAR_T_
112: #define ___int_wchar_t_h
1.1.1.2 root 113: #define _GCC_WCHAR_T
1.1 root 114: #ifndef __WCHAR_TYPE__
115: #define __WCHAR_TYPE__ int
116: #endif
1.1.1.3 ! root 117: /* Define this type if we are doing the whole job,
! 118: or if we want this type in particular. */
! 119: #if defined (_STDDEF_H) || defined (__need_wchar_t)
1.1 root 120: typedef __WCHAR_TYPE__ wchar_t;
1.1.1.3 ! root 121: #endif /* <stddef.h> or __need_wchar_t. */
1.1 root 122: #endif
123: #endif
124: #endif
125: #endif
126: #endif
127: #endif
1.1.1.2 root 128: #endif
1.1.1.3 ! root 129: #undef __need_wchar_t
1.1 root 130:
131: #endif /* __sys_stdtypes_h */
132:
133: /* A null pointer constant. */
134:
1.1.1.3 ! root 135: #if defined (_STDDEF_H) || defined (__need_NULL)
1.1 root 136: #undef NULL /* in case <stdio.h> has defined it. */
137: #define NULL ((void *)0)
1.1.1.3 ! root 138: #endif /* NULL not defined and <stddef.h> or need NULL. */
! 139: #undef __need_NULL
! 140:
! 141: #ifdef _STDDEF_H
1.1 root 142:
143: /* Offset of member MEMBER in a struct of type TYPE. */
144:
145: #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
146:
1.1.1.3 ! root 147: #endif /* _STDDEF_H was defined this time */
! 148: #endif /* _STDDEF_H_ was not defined before */
! 149: #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.