diff --git a/include/_ctype.h b/include/_ctype.h index e87570542b15..e14e514dd51c 100644 --- a/include/_ctype.h +++ b/include/_ctype.h @@ -116,11 +116,11 @@ __END_DECLS #define isspecial(c) __istype((c), _T) #endif -/* See comments in about _BSD_RUNE_T_. */ +/* See comments in about _BSD_CT_RUNE_T_. */ __BEGIN_DECLS -unsigned long ___runetype __P((_BSD_RUNE_T_)); -_BSD_RUNE_T_ ___tolower __P((_BSD_RUNE_T_)); -_BSD_RUNE_T_ ___toupper __P((_BSD_RUNE_T_)); +unsigned long ___runetype __P((_BSD_CT_RUNE_T_)); +_BSD_CT_RUNE_T_ ___tolower __P((_BSD_CT_RUNE_T_)); +_BSD_CT_RUNE_T_ ___toupper __P((_BSD_CT_RUNE_T_)); __END_DECLS /* @@ -139,28 +139,28 @@ __END_DECLS #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) static __inline int -__istype(_BSD_RUNE_T_ _c, unsigned long _f) +__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? !!(___runetype(_c) & _f) : !!(_CurrentRuneLocale->runetype[_c] & _f); } static __inline int -__isctype(_BSD_RUNE_T_ _c, unsigned long _f) +__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : !!(_DefaultRuneLocale.runetype[_c] & _f); } -static __inline _BSD_RUNE_T_ -__toupper(_BSD_RUNE_T_ _c) +static __inline _BSD_CT_RUNE_T_ +__toupper(_BSD_CT_RUNE_T_ _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]; } -static __inline _BSD_RUNE_T_ -__tolower(_BSD_RUNE_T_ _c) +static __inline _BSD_CT_RUNE_T_ +__tolower(_BSD_CT_RUNE_T_ _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : _CurrentRuneLocale->maplower[_c]; @@ -169,10 +169,10 @@ __tolower(_BSD_RUNE_T_ _c) #else /* not using inlines */ __BEGIN_DECLS -int __istype __P((_BSD_RUNE_T_, unsigned long)); -int __isctype __P((_BSD_RUNE_T_, unsigned long)); -_BSD_RUNE_T_ __toupper __P((_BSD_RUNE_T_)); -_BSD_RUNE_T_ __tolower __P((_BSD_RUNE_T_)); +int __istype __P((_BSD_CT_RUNE_T_, unsigned long)); +int __isctype __P((_BSD_CT_RUNE_T_, unsigned long)); +_BSD_CT_RUNE_T_ __toupper __P((_BSD_CT_RUNE_T_)); +_BSD_CT_RUNE_T_ __tolower __P((_BSD_CT_RUNE_T_)); __END_DECLS #endif /* using inlines */ diff --git a/include/ctype.h b/include/ctype.h index e87570542b15..e14e514dd51c 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -116,11 +116,11 @@ __END_DECLS #define isspecial(c) __istype((c), _T) #endif -/* See comments in about _BSD_RUNE_T_. */ +/* See comments in about _BSD_CT_RUNE_T_. */ __BEGIN_DECLS -unsigned long ___runetype __P((_BSD_RUNE_T_)); -_BSD_RUNE_T_ ___tolower __P((_BSD_RUNE_T_)); -_BSD_RUNE_T_ ___toupper __P((_BSD_RUNE_T_)); +unsigned long ___runetype __P((_BSD_CT_RUNE_T_)); +_BSD_CT_RUNE_T_ ___tolower __P((_BSD_CT_RUNE_T_)); +_BSD_CT_RUNE_T_ ___toupper __P((_BSD_CT_RUNE_T_)); __END_DECLS /* @@ -139,28 +139,28 @@ __END_DECLS #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) static __inline int -__istype(_BSD_RUNE_T_ _c, unsigned long _f) +__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? !!(___runetype(_c) & _f) : !!(_CurrentRuneLocale->runetype[_c] & _f); } static __inline int -__isctype(_BSD_RUNE_T_ _c, unsigned long _f) +__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : !!(_DefaultRuneLocale.runetype[_c] & _f); } -static __inline _BSD_RUNE_T_ -__toupper(_BSD_RUNE_T_ _c) +static __inline _BSD_CT_RUNE_T_ +__toupper(_BSD_CT_RUNE_T_ _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]; } -static __inline _BSD_RUNE_T_ -__tolower(_BSD_RUNE_T_ _c) +static __inline _BSD_CT_RUNE_T_ +__tolower(_BSD_CT_RUNE_T_ _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : _CurrentRuneLocale->maplower[_c]; @@ -169,10 +169,10 @@ __tolower(_BSD_RUNE_T_ _c) #else /* not using inlines */ __BEGIN_DECLS -int __istype __P((_BSD_RUNE_T_, unsigned long)); -int __isctype __P((_BSD_RUNE_T_, unsigned long)); -_BSD_RUNE_T_ __toupper __P((_BSD_RUNE_T_)); -_BSD_RUNE_T_ __tolower __P((_BSD_RUNE_T_)); +int __istype __P((_BSD_CT_RUNE_T_, unsigned long)); +int __isctype __P((_BSD_CT_RUNE_T_, unsigned long)); +_BSD_CT_RUNE_T_ __toupper __P((_BSD_CT_RUNE_T_)); +_BSD_CT_RUNE_T_ __tolower __P((_BSD_CT_RUNE_T_)); __END_DECLS #endif /* using inlines */ diff --git a/include/runetype.h b/include/runetype.h index 057cc35eb633..e7fdf5d74b11 100644 --- a/include/runetype.h +++ b/include/runetype.h @@ -39,13 +39,12 @@ #ifndef _RUNETYPE_H_ #define _RUNETYPE_H_ -#include #include +#include -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ rune_t; -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifdef _BSD_RUNE_T_ +typedef _BSD_RUNE_T_ rune_t; +#undef _BSD_RUNE_T_ #endif #ifdef _BSD_SIZE_T_ @@ -53,6 +52,11 @@ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif +#ifdef _BSD_WCHAR_T_ +typedef _BSD_WCHAR_T_ wchar_t; +#undef _BSD_WCHAR_T_ +#endif + #define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */ #define _CRMASK (~(_CACHED_RUNES - 1)) diff --git a/include/stddef.h b/include/stddef.h index 70af6892224a..38a773636a78 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -40,15 +40,19 @@ typedef _BSD_PTRDIFF_T_ ptrdiff_t; +#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#ifdef _BSD_RUNE_T_ +typedef _BSD_RUNE_T_ rune_t; +#undef _BSD_RUNE_T_ +#endif +#endif + #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif #ifdef _BSD_WCHAR_T_ -#ifndef _ANSI_SOURCE -typedef _BSD_WCHAR_T_ rune_t; -#endif typedef _BSD_WCHAR_T_ wchar_t; #undef _BSD_WCHAR_T_ #endif diff --git a/include/stdlib.h b/include/stdlib.h index 3f1d64895595..069656d4719b 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -38,15 +38,19 @@ #include +#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#ifdef _BSD_RUNE_T_ +typedef _BSD_RUNE_T_ rune_t; +#undef _BSD_RUNE_T_ +#endif +#endif + #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif #ifdef _BSD_WCHAR_T_ -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -typedef _BSD_WCHAR_T_ rune_t; -#endif typedef _BSD_WCHAR_T_ wchar_t; #undef _BSD_WCHAR_T_ #endif diff --git a/lib/libc/locale/runetype.c b/lib/libc/locale/runetype.c index a9bba8ef2727..282f806c2466 100644 --- a/lib/libc/locale/runetype.c +++ b/lib/libc/locale/runetype.c @@ -39,7 +39,7 @@ unsigned long ___runetype(c) - _BSD_RUNE_T_ c; + _BSD_CT_RUNE_T_ c; { #ifdef XPG4 int x; @@ -62,4 +62,3 @@ ___runetype(c) #endif return(0L); } - diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c index f8d16233e47c..65d5175a7b3c 100644 --- a/lib/libc/locale/tolower.c +++ b/lib/libc/locale/tolower.c @@ -37,9 +37,9 @@ #include #include -_BSD_RUNE_T_ +_BSD_CT_RUNE_T_ ___tolower(c) - _BSD_RUNE_T_ c; + _BSD_CT_RUNE_T_ c; { #ifdef XPG4 int x; @@ -58,5 +58,3 @@ ___tolower(c) #endif return(c); } - - diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c index 9e609774b81a..d2e4480d8fad 100644 --- a/lib/libc/locale/toupper.c +++ b/lib/libc/locale/toupper.c @@ -37,9 +37,9 @@ #include #include -_BSD_RUNE_T_ +_BSD_CT_RUNE_T_ ___toupper(c) - _BSD_RUNE_T_ c; + _BSD_CT_RUNE_T_ c; { #ifdef XPG4 int x; @@ -58,4 +58,3 @@ ___toupper(c) #endif return(c); } -