From: Richard Stallman Date: Sat, 31 Oct 1992 21:27:50 +0000 (+0000) Subject: [4.3 net 2]: If _SIZE_T_, etc. are undefined then type is already declared. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6be564d070dc48237f2fb43ac966538fb7b34464;p=gcc.git [4.3 net 2]: If _SIZE_T_, etc. are undefined then type is already declared. [4.3 net 2]: Force inclusion of ansi.h. Undef _SIZE_T_, _PTRDIFF_T_, _WCHAR_T_ at end. From-SVN: r2669 --- diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index 0b6bfa62347..e38425600df 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -17,13 +17,28 @@ /* This avoids lossage on SunOS but only if stdtypes.h comes first. There's no way to win with the other order! Sun lossage. */ -/* In 4.3bsd-net2, machine/ansi.h defines these symbols for some other - purpose. Undef them to prevent them from confusing this file. */ +/* 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____) +#include +#endif + +/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are + defined if the corresponding type is *not* defined. */ #ifdef _ANSI_H_ -#undef _PTRDIFF_T_ +#ifndef _SIZE_T_ +#define _SIZE_T +#endif +#ifndef _PTRDIFF_T_ +#define _PTRDIFF_T +#endif +#ifndef _WCHAR_T_ +#define _WCHAR_T +#endif #undef _SIZE_T_ +#undef _PTRDIFF_T_ #undef _WCHAR_T_ -#endif +#endif /* _ANSI_H_ */ /* In case nobody has defined these types, but we aren't running under GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and @@ -147,6 +162,16 @@ typedef __WCHAR_TYPE__ wchar_t; #undef __need_wchar_t #endif /* _STDDEF_H or __need_wchar_t. */ +/* 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_ +#undef _SIZE_T_ +#undef _WCHAR_T_ +#endif + #endif /* __sys_stdtypes_h */ /* A null pointer constant. */