1991-11-27 15:06:32 -05:00
|
|
|
#ifndef _STDDEF_H
|
|
|
|
#ifndef _STDDEF_H_
|
1992-10-17 00:41:39 -04:00
|
|
|
#ifndef _ANSI_STDDEF_H
|
1992-03-29 21:25:19 -05:00
|
|
|
|
|
|
|
/* Any one of these symbols __need_* means that GNU libc
|
|
|
|
wants us just to define one data type. So don't define
|
|
|
|
the symbols that indicate this file's entire job has been done. */
|
|
|
|
#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
|
|
|
|
&& !defined(__need_ptrdiff_t) && !defined(__need_NULL))
|
1991-11-27 15:06:32 -05:00
|
|
|
#define _STDDEF_H
|
|
|
|
#define _STDDEF_H_
|
1992-10-15 04:05:45 -04:00
|
|
|
/* snaroff@next.com says the NeXT needs this. */
|
|
|
|
#define _ANSI_STDDEF_H
|
1992-03-29 21:25:19 -05:00
|
|
|
#endif
|
1991-11-27 15:06:32 -05:00
|
|
|
|
|
|
|
#ifndef __sys_stdtypes_h
|
1992-06-23 23:59:40 -04:00
|
|
|
/* This avoids lossage on SunOS but only if stdtypes.h comes first.
|
1991-11-27 15:06:32 -05:00
|
|
|
There's no way to win with the other order! Sun lossage. */
|
|
|
|
|
1992-10-31 16:27:50 -05:00
|
|
|
/* On 4.3bsd-net2, make sure ansi.h is included, so we have
|
|
|
|
one less case to deal with in the following. */
|
|
|
|
#if defined (__BSD_NET2__) || defined (____386BSD____)
|
1992-11-10 10:26:10 -05:00
|
|
|
#include <machine/ansi.h>
|
1992-10-31 16:27:50 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
|
|
|
|
defined if the corresponding type is *not* defined. */
|
1992-10-01 02:11:57 -04:00
|
|
|
#ifdef _ANSI_H_
|
1992-10-31 16:27:50 -05:00
|
|
|
#ifndef _SIZE_T_
|
|
|
|
#define _SIZE_T
|
|
|
|
#endif
|
|
|
|
#ifndef _PTRDIFF_T_
|
|
|
|
#define _PTRDIFF_T
|
|
|
|
#endif
|
|
|
|
#ifndef _WCHAR_T_
|
|
|
|
#define _WCHAR_T
|
|
|
|
#endif
|
|
|
|
#undef _PTRDIFF_T_
|
1992-11-10 10:26:10 -05:00
|
|
|
#ifndef __need_ptrdiff_t
|
|
|
|
#undef _SIZE_T_
|
1992-10-01 02:11:57 -04:00
|
|
|
#undef _WCHAR_T_
|
1992-11-10 10:26:10 -05:00
|
|
|
#endif
|
1992-10-31 16:27:50 -05:00
|
|
|
#endif /* _ANSI_H_ */
|
1992-10-01 02:11:57 -04:00
|
|
|
|
1991-12-13 15:28:29 -05:00
|
|
|
/* In case nobody has defined these types, but we aren't running under
|
|
|
|
GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
|
|
|
|
__WCHAR_TYPE__ have reasonable values. This can happen if the
|
|
|
|
parts of GCC is compiled by an older compiler, that actually
|
|
|
|
include gstddef.h, such as collect2. */
|
|
|
|
|
1991-11-27 15:06:32 -05:00
|
|
|
/* Signed type of difference of two pointers. */
|
|
|
|
|
1992-07-01 19:29:59 -04:00
|
|
|
/* Define this type if we are doing the whole job,
|
|
|
|
or if we want this type in particular. */
|
|
|
|
#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
|
1991-11-27 15:06:32 -05:00
|
|
|
#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
|
1992-03-18 00:21:50 -05:00
|
|
|
#ifndef _T_PTRDIFF_
|
1991-11-27 15:06:32 -05:00
|
|
|
#ifndef _T_PTRDIFF
|
|
|
|
#ifndef __PTRDIFF_T
|
|
|
|
#ifndef _PTRDIFF_T_
|
|
|
|
#ifndef ___int_ptrdiff_t_h
|
1992-03-18 00:21:50 -05:00
|
|
|
#ifndef _GCC_PTRDIFF_T
|
1991-11-27 15:06:32 -05:00
|
|
|
#define _PTRDIFF_T
|
1992-03-18 00:21:50 -05:00
|
|
|
#define _T_PTRDIFF_
|
1991-11-27 15:06:32 -05:00
|
|
|
#define _T_PTRDIFF
|
|
|
|
#define __PTRDIFF_T
|
|
|
|
#define _PTRDIFF_T_
|
|
|
|
#define ___int_ptrdiff_t_h
|
1992-03-18 00:21:50 -05:00
|
|
|
#define _GCC_PTRDIFF_T
|
1991-12-13 15:28:29 -05:00
|
|
|
#ifndef __PTRDIFF_TYPE__
|
|
|
|
#define __PTRDIFF_TYPE__ long int
|
|
|
|
#endif
|
1991-11-27 15:06:32 -05:00
|
|
|
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
1992-03-18 00:21:50 -05:00
|
|
|
#endif /* _GCC_PTRDIFF_T */
|
1991-11-27 15:06:32 -05:00
|
|
|
#endif /* ___int_ptrdiff_t_h */
|
|
|
|
#endif /* _PTRDIFF_T_ */
|
|
|
|
#endif /* __PTRDIFF_T */
|
|
|
|
#endif /* _T_PTRDIFF */
|
1992-03-18 00:21:50 -05:00
|
|
|
#endif /* _T_PTRDIFF_ */
|
1991-11-27 15:06:32 -05:00
|
|
|
#endif /* _PTRDIFF_T */
|
|
|
|
|
1992-03-29 21:25:19 -05:00
|
|
|
/* If this symbol has done its job, get rid of it. */
|
|
|
|
#undef __need_ptrdiff_t
|
|
|
|
|
1992-07-01 19:29:59 -04:00
|
|
|
#endif /* _STDDEF_H or __need_ptrdiff_t. */
|
|
|
|
|
1991-11-27 15:06:32 -05:00
|
|
|
/* Unsigned type of `sizeof' something. */
|
|
|
|
|
1992-07-01 19:29:59 -04:00
|
|
|
/* Define this type if we are doing the whole job,
|
|
|
|
or if we want this type in particular. */
|
|
|
|
#if defined (_STDDEF_H) || defined (__need_size_t)
|
1991-11-27 15:06:32 -05:00
|
|
|
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
|
1992-03-18 00:21:50 -05:00
|
|
|
#ifndef _T_SIZE_
|
1991-11-27 15:06:32 -05:00
|
|
|
#ifndef _T_SIZE
|
|
|
|
#ifndef __SIZE_T
|
|
|
|
#ifndef _SIZE_T_
|
|
|
|
#ifndef ___int_size_t_h
|
1992-03-18 00:21:50 -05:00
|
|
|
#ifndef _GCC_SIZE_T
|
1992-03-27 16:25:33 -05:00
|
|
|
#ifndef _SIZET_
|
1991-11-27 15:06:32 -05:00
|
|
|
#define _SIZE_T
|
1992-03-18 00:21:50 -05:00
|
|
|
#define _T_SIZE_
|
1991-11-27 15:06:32 -05:00
|
|
|
#define _T_SIZE
|
|
|
|
#define __SIZE_T
|
|
|
|
#define _SIZE_T_
|
|
|
|
#define ___int_size_t_h
|
1992-03-18 00:21:50 -05:00
|
|
|
#define _GCC_SIZE_T
|
1992-03-27 16:25:33 -05:00
|
|
|
#define _SIZET_
|
1991-12-13 15:28:29 -05:00
|
|
|
#ifndef __SIZE_TYPE__
|
|
|
|
#define __SIZE_TYPE__ long unsigned int
|
|
|
|
#endif
|
1991-11-27 15:06:32 -05:00
|
|
|
typedef __SIZE_TYPE__ size_t;
|
1992-03-27 16:25:33 -05:00
|
|
|
#endif /* _SIZET_ */
|
1992-03-18 00:21:50 -05:00
|
|
|
#endif /* _GCC_SIZE_T */
|
1991-11-27 15:06:32 -05:00
|
|
|
#endif /* ___int_size_t_h */
|
|
|
|
#endif /* _SIZE_T_ */
|
|
|
|
#endif /* __SIZE_T */
|
|
|
|
#endif /* _T_SIZE */
|
1992-03-18 00:21:50 -05:00
|
|
|
#endif /* _T_SIZE_ */
|
1991-11-27 15:06:32 -05:00
|
|
|
#endif /* _SIZE_T */
|
1992-03-29 21:25:19 -05:00
|
|
|
#undef __need_size_t
|
1992-07-01 19:29:59 -04:00
|
|
|
#endif /* _STDDEF_H or __need_size_t. */
|
1991-11-27 15:06:32 -05:00
|
|
|
|
1992-03-29 21:25:19 -05:00
|
|
|
|
|
|
|
/* Wide character type.
|
|
|
|
Locale-writers should change this as necessary to
|
|
|
|
be big enough to hold unique values not between 0 and 127,
|
|
|
|
and not (wchar_t) -1, for each defined multibyte character. */
|
1991-11-27 15:06:32 -05:00
|
|
|
|
1992-07-01 19:29:59 -04:00
|
|
|
/* Define this type if we are doing the whole job,
|
|
|
|
or if we want this type in particular. */
|
|
|
|
#if defined (_STDDEF_H) || defined (__need_wchar_t)
|
1991-11-27 15:06:32 -05:00
|
|
|
#ifndef _WCHAR_T
|
|
|
|
#ifndef _T_WCHAR_
|
1992-01-15 01:01:38 -05:00
|
|
|
#ifndef _T_WCHAR
|
1991-11-27 15:06:32 -05:00
|
|
|
#ifndef __WCHAR_T
|
|
|
|
#ifndef _WCHAR_T_
|
|
|
|
#ifndef ___int_wchar_t_h
|
1992-03-18 00:21:50 -05:00
|
|
|
#ifndef _GCC_WCHAR_T
|
1991-11-27 15:06:32 -05:00
|
|
|
#define _WCHAR_T
|
|
|
|
#define _T_WCHAR_
|
1992-01-15 01:01:38 -05:00
|
|
|
#define _T_WCHAR
|
1991-11-27 15:06:32 -05:00
|
|
|
#define __WCHAR_T
|
|
|
|
#define _WCHAR_T_
|
|
|
|
#define ___int_wchar_t_h
|
1992-03-18 00:21:50 -05:00
|
|
|
#define _GCC_WCHAR_T
|
1991-12-13 15:28:29 -05:00
|
|
|
#ifndef __WCHAR_TYPE__
|
|
|
|
#define __WCHAR_TYPE__ int
|
|
|
|
#endif
|
1992-07-28 01:36:01 -04:00
|
|
|
#ifdef __GNUG__
|
|
|
|
/* In C++, wchar_t is a distinct basic type,
|
|
|
|
and we can expect __wchar_t to be defined by cc1plus. */
|
|
|
|
typedef __wchar_t wchar_t;
|
|
|
|
#else
|
|
|
|
/* In C, cpp tells us which type to make an alias for. */
|
1991-11-27 15:06:32 -05:00
|
|
|
typedef __WCHAR_TYPE__ wchar_t;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
1992-01-15 01:01:38 -05:00
|
|
|
#endif
|
1992-03-18 00:21:50 -05:00
|
|
|
#endif
|
1992-07-28 01:36:01 -04:00
|
|
|
#endif
|
1992-06-11 15:08:00 -04:00
|
|
|
#undef __need_wchar_t
|
1992-07-01 19:29:59 -04:00
|
|
|
#endif /* _STDDEF_H or __need_wchar_t. */
|
1991-11-27 15:06:32 -05:00
|
|
|
|
1992-10-31 16:27:50 -05:00
|
|
|
/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
|
|
|
|
are already defined. We need not worry about the case of wanting just
|
|
|
|
one of these types, not on 4.3bsd-net2, because only the GNU libc
|
|
|
|
header files do that. */
|
|
|
|
#ifdef _ANSI_H_
|
|
|
|
#undef _PTRDIFF_T_
|
1992-11-10 10:26:10 -05:00
|
|
|
#ifndef _STDDEF_H /* This is a kludge. The case where this happens
|
|
|
|
is when obstack.h wants just ptrdiff_t. */
|
1992-10-31 16:27:50 -05:00
|
|
|
#undef _SIZE_T_
|
|
|
|
#undef _WCHAR_T_
|
|
|
|
#endif
|
1992-11-10 10:26:10 -05:00
|
|
|
#endif
|
1992-10-31 16:27:50 -05:00
|
|
|
|
1991-11-27 15:06:32 -05:00
|
|
|
#endif /* __sys_stdtypes_h */
|
|
|
|
|
|
|
|
/* A null pointer constant. */
|
|
|
|
|
1992-03-29 21:25:19 -05:00
|
|
|
#if defined (_STDDEF_H) || defined (__need_NULL)
|
1991-11-27 15:06:32 -05:00
|
|
|
#undef NULL /* in case <stdio.h> has defined it. */
|
|
|
|
#define NULL ((void *)0)
|
1992-03-29 21:25:19 -05:00
|
|
|
#endif /* NULL not defined and <stddef.h> or need NULL. */
|
|
|
|
#undef __need_NULL
|
|
|
|
|
|
|
|
#ifdef _STDDEF_H
|
1991-11-27 15:06:32 -05:00
|
|
|
|
|
|
|
/* Offset of member MEMBER in a struct of type TYPE. */
|
|
|
|
|
|
|
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
|
|
|
|
1992-03-29 21:25:19 -05:00
|
|
|
#endif /* _STDDEF_H was defined this time */
|
1992-10-17 00:41:39 -04:00
|
|
|
|
|
|
|
#endif /* _ANSI_STDDEF_H was not defined before */
|
1992-03-29 21:25:19 -05:00
|
|
|
#endif /* _STDDEF_H_ was not defined before */
|
|
|
|
#endif /* _STDDEF_H was not defined before */
|