Subversion Repositories shark

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/*
22
 * Copyright (C) 1999 Massimiliano Giorgi
23
 *
24
 * This program is free software; you can redistribute it and/or modify
25
 * it under the terms of the GNU General Public License as published by
26
 * the Free Software Foundation; either version 2 of the License, or
27
 * (at your option) any later version.
28
 *
29
 * This program is distributed in the hope that it will be useful,
30
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32
 * GNU General Public License for more details.
33
 *
34
 * You should have received a copy of the GNU General Public License
35
 * along with this program; if not, write to the Free Software
36
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37
 *
38
 */
39
 
40
/*
41
 * This is based on /usr/include/stddef.h of a Linux system with
42
 * gcc 2.7.3. It has not a copyright line or an author name ?!?
43
 */
44
 
45
/*
46
 * CVS :        $Id: stddef.h,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
47
 *
48
 * File:        include/stddef.h
49
 * Revision:    $Revision: 1.1.1.1 $
50
 * Last update: $Date: 2002-03-29 14:12:51 $
51
 */
52
 
53
#ifndef _STDDEF_H
54
#ifndef _STDDEF_H_
55
#ifndef _ANSI_STDDEF_H
56
#ifndef __STDDEF_H__
57
 
58
#include <ll/sys/types.h>
59
 
60
/* Any one of these symbols __need_* means that GNU libc
61
   wants us just to define one data type.  So don't define
62
   the symbols that indicate this file's entire job has been done.  */
63
#if (!defined(__need_wchar_t) && !defined(__need_size_t)        \
64
     && !defined(__need_ptrdiff_t) && !defined(__need_NULL))
65
#define _STDDEF_H
66
#define _STDDEF_H_
67
/* snaroff@next.com says the NeXT needs this.  */
68
#define _ANSI_STDDEF_H
69
/* Irix 5.1 needs this.  */
70
#define __STDDEF_H__
71
#endif
72
 
73
#ifndef __sys_stdtypes_h
74
/* This avoids lossage on SunOS but only if stdtypes.h comes first.
75
   There's no way to win with the other order!  Sun lossage.  */
76
 
77
/* On 4.3bsd-net2, make sure ansi.h is included, so we have
78
   one less case to deal with in the following.  */
79
#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__)
80
#include <machine/ansi.h>
81
#endif
82
 
83
/* on S.Ha.R.K. this are already defined */
84
 
85
#ifdef __LL_SYS_TYPES_H__
86
#define _SIZE_T
87
#endif
88
 
89
/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
90
    defined if the corresponding type is *not* defined.  */
91
#ifdef _ANSI_H_
92
#ifndef _SIZE_T_
93
#define _SIZE_T
94
#endif
95
#ifndef _PTRDIFF_T_
96
#define _PTRDIFF_T
97
#endif
98
/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
99
   instead of _WCHAR_T_. */
100
#ifndef _WCHAR_T_
101
#ifndef _BSD_WCHAR_T_
102
#define _WCHAR_T
103
#endif
104
#endif
105
/* Undef _FOO_T_ if we are supposed to define foo_t.  */
106
#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
107
#undef _PTRDIFF_T_
108
#endif
109
#if defined (__need_size_t) || defined (_STDDEF_H_)
110
#undef _SIZE_T_
111
#endif
112
#if defined (__need_wchar_t) || defined (_STDDEF_H_)
113
#undef _WCHAR_T_
114
#endif
115
#endif /* _ANSI_H_ */
116
 
117
/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
118
   Just ignore it.  */
119
#if defined (__sequent__) && defined (_PTRDIFF_T_)
120
#undef _PTRDIFF_T_
121
#endif
122
 
123
/* In case nobody has defined these types, but we aren't running under
124
   GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
125
   __WCHAR_TYPE__ have reasonable values.  This can happen if the
126
   parts of GCC is compiled by an older compiler, that actually
127
   include gstddef.h, such as collect2.  */
128
 
129
/* Signed type of difference of two pointers.  */
130
 
131
/* Define this type if we are doing the whole job,
132
   or if we want this type in particular.  */
133
#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
134
#ifndef _PTRDIFF_T      /* in case <sys/types.h> has defined it. */
135
#ifndef _T_PTRDIFF_
136
#ifndef _T_PTRDIFF
137
#ifndef __PTRDIFF_T
138
#ifndef _PTRDIFF_T_
139
#ifndef ___int_ptrdiff_t_h
140
#ifndef _GCC_PTRDIFF_T
141
#define _PTRDIFF_T
142
#define _T_PTRDIFF_
143
#define _T_PTRDIFF
144
#define __PTRDIFF_T
145
#define _PTRDIFF_T_
146
#define ___int_ptrdiff_t_h
147
#define _GCC_PTRDIFF_T
148
#ifndef __PTRDIFF_TYPE__
149
#define __PTRDIFF_TYPE__ long int
150
#endif
151
typedef __PTRDIFF_TYPE__ ptrdiff_t;
152
#endif /* _GCC_PTRDIFF_T */
153
#endif /* ___int_ptrdiff_t_h */
154
#endif /* _PTRDIFF_T_ */
155
#endif /* __PTRDIFF_T */
156
#endif /* _T_PTRDIFF */
157
#endif /* _T_PTRDIFF_ */
158
#endif /* _PTRDIFF_T */
159
 
160
/* If this symbol has done its job, get rid of it.  */
161
#undef  __need_ptrdiff_t
162
 
163
#endif /* _STDDEF_H or __need_ptrdiff_t.  */
164
 
165
/* Unsigned type of `sizeof' something.  */
166
 
167
/* Define this type if we are doing the whole job,
168
   or if we want this type in particular.  */
169
#if defined (_STDDEF_H) || defined (__need_size_t)
170
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
171
#ifndef _SYS_SIZE_T_H
172
#ifndef _T_SIZE_
173
#ifndef _T_SIZE
174
#ifndef __SIZE_T
175
#ifndef _SIZE_T_
176
#ifndef _SIZE_T_DEFINED_
177
#ifndef ___int_size_t_h
178
#ifndef _GCC_SIZE_T
179
#ifndef _SIZET_
180
#ifndef __size_t
181
#define _SIZE_T
182
#define _SYS_SIZE_T_H
183
#define _T_SIZE_
184
#define _T_SIZE
185
#define __SIZE_T
186
#define _SIZE_T_
187
#define _SIZE_T_DEFINED_
188
#define ___int_size_t_h
189
#define _GCC_SIZE_T
190
#define _SIZET_
191
#define __size_t
192
#ifndef __SIZE_TYPE__
193
#define __SIZE_TYPE__ long unsigned int
194
#endif
195
#if !(defined (__GNUG__) && defined (size_t))
196
typedef __SIZE_TYPE__ size_t;
197
#endif /* !(defined (__GNUG__) && defined (size_t)) */
198
#endif /* __size_t */
199
#endif /* _SIZET_ */
200
#endif /* _GCC_SIZE_T */
201
#endif /* ___int_size_t_h */
202
#endif /* _SIZE_T_DEFINED_ */
203
#endif /* _SIZE_T_ */
204
#endif /* __SIZE_T */
205
#endif /* _T_SIZE */
206
#endif /* _T_SIZE_ */
207
#endif /* _SYS_SIZE_T_H */
208
#endif /* _SIZE_T */
209
#undef  __need_size_t
210
#endif /* _STDDEF_H or __need_size_t.  */
211
 
212
 
213
/* Wide character type.
214
   Locale-writers should change this as necessary to
215
   be big enough to hold unique values not between 0 and 127,
216
   and not (wchar_t) -1, for each defined multibyte character.  */
217
 
218
/* Define this type if we are doing the whole job,
219
   or if we want this type in particular.  */
220
#if defined (_STDDEF_H) || defined (__need_wchar_t)
221
#ifndef _WCHAR_T
222
#ifndef _T_WCHAR_
223
#ifndef _T_WCHAR
224
#ifndef __WCHAR_T
225
#ifndef _WCHAR_T_
226
#ifndef _WCHAR_T_DEFINED_
227
#ifndef _WCHAR_T_H
228
#ifndef ___int_wchar_t_h
229
#ifndef __INT_WCHAR_T_H
230
#ifndef _GCC_WCHAR_T
231
#define _WCHAR_T
232
#define _T_WCHAR_
233
#define _T_WCHAR
234
#define __WCHAR_T
235
#define _WCHAR_T_
236
#define _WCHAR_T_DEFINED_
237
#define _WCHAR_T_H
238
#define ___int_wchar_t_h
239
#define __INT_WCHAR_T_H
240
#define _GCC_WCHAR_T
241
 
242
/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
243
   instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
244
   symbols in the _FOO_T_ family, stays defined even after its
245
   corresponding type is defined).  If we define wchar_t, then we
246
   must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
247
   we undef _WCHAR_T_, then we must also define rune_t, since
248
   headers like runetype.h assume that if machine/ansi.h is included,
249
   and _BSD_WCHAR_T_ is not defined, then rune_t is available.
250
   machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
251
   the same type." */
252
#ifdef _BSD_WCHAR_T_
253
#undef _BSD_WCHAR_T_
254
#ifdef _BSD_RUNE_T_
255
#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
256
typedef _BSD_RUNE_T_ rune_t;
257
#endif
258
#endif
259
#endif
260
 
261
#ifndef __WCHAR_TYPE__
262
#define __WCHAR_TYPE__ int
263
#endif
264
typedef __WCHAR_TYPE__ wchar_t;
265
#endif
266
#endif
267
#endif
268
#endif
269
#endif
270
#endif
271
#endif
272
#endif
273
#endif
274
#endif
275
#undef  __need_wchar_t
276
#endif /* _STDDEF_H or __need_wchar_t.  */
277
 
278
/*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
279
    are already defined.  */
280
#ifdef _ANSI_H_
281
/*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
282
    are probably typos and should be removed before 2.7 is released.  */
283
#ifdef _GCC_PTRDIFF_T_
284
#undef _PTRDIFF_T_
285
#endif
286
#ifdef _GCC_SIZE_T_
287
#undef _SIZE_T_
288
#endif
289
#ifdef _GCC_WCHAR_T_
290
#undef _WCHAR_T_
291
#endif
292
/*  The following ones are the real ones.  */
293
#ifdef _GCC_PTRDIFF_T
294
#undef _PTRDIFF_T_
295
#endif
296
#ifdef _GCC_SIZE_T
297
#undef _SIZE_T_
298
#endif
299
#ifdef _GCC_WCHAR_T
300
#undef _WCHAR_T_
301
#endif
302
#endif /* _ANSI_H_ */
303
 
304
#endif /* __sys_stdtypes_h */
305
 
306
/* A null pointer constant.  */
307
 
308
#if defined (_STDDEF_H) || defined (__need_NULL)
309
#undef NULL             /* in case <stdio.h> has defined it. */
310
#define NULL ((void *)0)
311
#endif  /* NULL not defined and <stddef.h> or need NULL.  */
312
#undef  __need_NULL
313
 
314
#ifdef _STDDEF_H
315
 
316
/* Offset of member MEMBER in a struct of type TYPE.  */
317
 
318
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
319
 
320
#endif /* _STDDEF_H was defined this time */
321
 
322
#endif /* __STDDEF_H__ was not defined before */
323
#endif /* _ANSI_STDDEF_H was not defined before */
324
#endif /* _STDDEF_H_ was not defined before */
325
#endif /* _STDDEF_H was not defined before */