OSDN Git Service

Handle _BSD_WCHAR_T_ like _WCHAR_T_, since at least BSD/386 1.1 uses
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Aug 1994 22:52:34 +0000 (22:52 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Aug 1994 22:52:34 +0000 (22:52 +0000)
the former instead of the latter.  If _BSD_RUNE_T_ is defined, then
define rune_t when we define wchar_t.  Test definedness of _GCC_SIZE_T
as well as _GCC_SIZE_T_; likewise for _GCC_PTRDIFF_T and _GCC_WCHAR_T.

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

gcc/ginclude/stddef.h

index 72753ae..11c4829 100644 (file)
 #ifndef _PTRDIFF_T_
 #define _PTRDIFF_T
 #endif
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+   instead of _WCHAR_T_. */
 #ifndef _WCHAR_T_
+#ifndef _BSD_WCHAR_T_
 #define _WCHAR_T
 #endif
+#endif
 /* Undef _FOO_T_ if we are supposed to define foo_t.  */
 #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
 #undef _PTRDIFF_T_
@@ -169,6 +173,26 @@ typedef __SIZE_TYPE__ size_t;
 #define ___int_wchar_t_h
 #define __INT_WCHAR_T_H
 #define _GCC_WCHAR_T
+
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+   instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+   symbols in the _FOO_T_ family, stays defined even after its
+   corresponding type is defined).  If we define wchar_t, then we
+   must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
+   we undef _WCHAR_T_, then we must also define rune_t, since 
+   headers like runetype.h assume that if machine/ansi.h is included,
+   and _BSD_WCHAR_T_ is not defined, then rune_t is available.
+   machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
+   the same type." */
+#ifdef _BSD_WCHAR_T_
+#undef _BSD_WCHAR_T_
+#ifdef _BSD_RUNE_T_
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+typedef _BSD_RUNE_T_ rune_t;
+#endif
+#endif
+#endif
+
 #ifndef __WCHAR_TYPE__
 #define __WCHAR_TYPE__ int
 #endif
@@ -188,6 +212,8 @@ typedef __WCHAR_TYPE__ wchar_t;
 /*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
     are already defined.  */
 #ifdef _ANSI_H_
+/*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
+    are probably typos and should be removed before 2.7 is released.  */
 #ifdef _GCC_PTRDIFF_T_
 #undef _PTRDIFF_T_
 #endif
@@ -197,6 +223,16 @@ typedef __WCHAR_TYPE__ wchar_t;
 #ifdef _GCC_WCHAR_T_
 #undef _WCHAR_T_
 #endif
+/*  The following ones are the real ones.  */
+#ifdef _GCC_PTRDIFF_T
+#undef _PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T
+#undef _SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T
+#undef _WCHAR_T_
+#endif
 #endif /* _ANSI_H_ */
 
 #endif /* __sys_stdtypes_h */