diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-08-01 18:52:34 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-08-01 18:52:34 -0400 |
commit | 73c8c157adf578b5fcd51d9a55a2dc5c3484a113 (patch) | |
tree | 0b4b177d5d1b2099b9c5278d893779ad437a78dd /gcc/ginclude | |
parent | b93f0d49245cad4230a57a20cfb598975fe4e121 (diff) | |
download | gcc-73c8c157adf578b5fcd51d9a55a2dc5c3484a113.tar.gz |
Handle _BSD_WCHAR_T_ like _WCHAR_T_, since at least BSD/386 1.1 uses the former instead of the latter.
Handle _BSD_WCHAR_T_ like _WCHAR_T_, since at least BSD/386 1.1 uses
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.
From-SVN: r7844
Diffstat (limited to 'gcc/ginclude')
-rw-r--r-- | gcc/ginclude/stddef.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index 72753ae67c4..11c4829f1cb 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -35,9 +35,13 @@ #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 */ |