OSDN Git Service

[4.3 net 2]: If _SIZE_T_, etc. are undefined then type is already declared.
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Oct 1992 21:27:50 +0000 (21:27 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Oct 1992 21:27:50 +0000 (21:27 +0000)
[4.3 net 2]: Force inclusion of ansi.h.
Undef _SIZE_T_, _PTRDIFF_T_, _WCHAR_T_ at end.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2669 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ginclude/stddef.h

index 0b6bfa6..e384256 100644 (file)
 /* 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 <ansi.h>
+#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.  */