OSDN Git Service

*** empty log message ***
[pf3gnuchains/gcc-fork.git] / gcc / ginclude / stddef.h
1 #ifndef _STDDEF_H
2 #ifndef _STDDEF_H_
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))
9 #define _STDDEF_H
10 #define _STDDEF_H_
11 #endif
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. */
26 #ifndef _T_PTRDIFF_
27 #ifndef _T_PTRDIFF
28 #ifndef __PTRDIFF_T
29 #ifndef _PTRDIFF_T_
30 #ifndef ___int_ptrdiff_t_h
31 #ifndef _GCC_PTRDIFF_T
32 #define _PTRDIFF_T
33 #define _T_PTRDIFF_
34 #define _T_PTRDIFF
35 #define __PTRDIFF_T
36 #define _PTRDIFF_T_
37 #define ___int_ptrdiff_t_h
38 #define _GCC_PTRDIFF_T
39 #ifndef __PTRDIFF_TYPE__
40 #define __PTRDIFF_TYPE__ long int
41 #endif
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)
45 typedef __PTRDIFF_TYPE__ ptrdiff_t;
46 #endif /* <stddef.h> or __need_ptrdiff_t.  */
47 #endif /* _GCC_PTRDIFF_T */
48 #endif /* ___int_ptrdiff_t_h */
49 #endif /* _PTRDIFF_T_ */
50 #endif /* __PTRDIFF_T */
51 #endif /* _T_PTRDIFF */
52 #endif /* _T_PTRDIFF_ */
53 #endif /* _PTRDIFF_T */
54
55 /* If this symbol has done its job, get rid of it.  */
56 #undef  __need_ptrdiff_t
57
58 /* Unsigned type of `sizeof' something.  */
59
60 #ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
61 #ifndef _T_SIZE_
62 #ifndef _T_SIZE
63 #ifndef __SIZE_T
64 #ifndef _SIZE_T_
65 #ifndef ___int_size_t_h
66 #ifndef _GCC_SIZE_T
67 #ifndef _SIZET_
68 #define _SIZE_T
69 #define _T_SIZE_
70 #define _T_SIZE
71 #define __SIZE_T
72 #define _SIZE_T_
73 #define ___int_size_t_h
74 #define _GCC_SIZE_T
75 #define _SIZET_
76 #ifndef __SIZE_TYPE__
77 #define __SIZE_TYPE__ long unsigned int
78 #endif
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)
82 typedef __SIZE_TYPE__ size_t;
83 #endif /* <stddef.h> or __need_size_t.  */
84 #endif /* _SIZET_ */
85 #endif /* _GCC_SIZE_T */
86 #endif /* ___int_size_t_h */
87 #endif /* _SIZE_T_ */
88 #endif /* __SIZE_T */
89 #endif /* _T_SIZE */
90 #endif /* _T_SIZE_ */
91 #endif /* _SIZE_T */
92 #undef  __need_size_t
93
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.  */
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
106 #ifndef _GCC_WCHAR_T
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
113 #define _GCC_WCHAR_T
114 #ifndef __WCHAR_TYPE__
115 #define __WCHAR_TYPE__ int
116 #endif
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)
120 typedef __WCHAR_TYPE__ wchar_t;
121 #endif /* <stddef.h> or __need_wchar_t.  */
122 #endif
123 #endif
124 #endif
125 #endif
126 #endif
127 #endif
128 #endif
129 #undef  __need_wchar_t
130
131 #endif /* __sys_stdtypes_h */
132
133 /* A null pointer constant.  */
134
135 #if defined (_STDDEF_H) || defined (__need_NULL)
136 #undef NULL             /* in case <stdio.h> has defined it. */
137 #define NULL ((void *)0)
138 #endif  /* NULL not defined and <stddef.h> or need NULL.  */
139 #undef  __need_NULL
140
141 #ifdef _STDDEF_H
142
143 /* Offset of member MEMBER in a struct of type TYPE.  */
144
145 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
146
147 #endif /* _STDDEF_H was defined this time */
148 #endif /* _STDDEF_H_ was not defined before */
149 #endif /* _STDDEF_H was not defined before */