diff options
author | bbraun <bbraun@FreeBSD.org> | 2002-02-05 06:21:34 +0000 |
---|---|---|
committer | bbraun <bbraun@FreeBSD.org> | 2002-02-05 06:21:34 +0000 |
commit | 296f340c65d52c35255990dfd56c7d43c7d6a0c3 (patch) | |
tree | 8befa2a99b61188736752cb2f0a1186b4c1170f0 /include | |
parent | 71559bdb87817b94ae20e148f9e860302791d44d (diff) | |
download | FreeBSD-src-296f340c65d52c35255990dfd56c7d43c7d6a0c3.zip FreeBSD-src-296f340c65d52c35255990dfd56c7d43c7d6a0c3.tar.gz |
Makes __istype() an inline (and a non inlined) function to avoid C++
compile issues. std::isspace(' ') was expanding to std::(!!_maskrune...)
which would cause a C++ compile error. Making __istype() an inline
causes the expansion to be std::__istype() instead, which is valid.
Reviewed by: jkh
Diffstat (limited to 'include')
-rw-r--r-- | include/_ctype.h | 9 | ||||
-rw-r--r-- | include/ctype.h | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/include/_ctype.h b/include/_ctype.h index 1f266fe..31df497 100644 --- a/include/_ctype.h +++ b/include/_ctype.h @@ -95,8 +95,6 @@ int toascii __P((int)); #endif __END_DECLS -#define __istype(c,f) (!!__maskrune((c),(f))) - #define isalnum(c) __istype((c), _CTYPE_A|_CTYPE_D) #define isalpha(c) __istype((c), _CTYPE_A) #define iscntrl(c) __istype((c), _CTYPE_C) @@ -154,6 +152,12 @@ __maskrune(_BSD_CT_RUNE_T_ _c, unsigned long _f) } static __inline int +__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f) +{ + return (!!__maskrune(_c, _f)); +} + +static __inline int __isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : @@ -178,6 +182,7 @@ __tolower(_BSD_CT_RUNE_T_ _c) __BEGIN_DECLS int __maskrune __P((_BSD_CT_RUNE_T_, unsigned long)); +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_)); diff --git a/include/ctype.h b/include/ctype.h index 1f266fe..31df497 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -95,8 +95,6 @@ int toascii __P((int)); #endif __END_DECLS -#define __istype(c,f) (!!__maskrune((c),(f))) - #define isalnum(c) __istype((c), _CTYPE_A|_CTYPE_D) #define isalpha(c) __istype((c), _CTYPE_A) #define iscntrl(c) __istype((c), _CTYPE_C) @@ -154,6 +152,12 @@ __maskrune(_BSD_CT_RUNE_T_ _c, unsigned long _f) } static __inline int +__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f) +{ + return (!!__maskrune(_c, _f)); +} + +static __inline int __isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : @@ -178,6 +182,7 @@ __tolower(_BSD_CT_RUNE_T_ _c) __BEGIN_DECLS int __maskrune __P((_BSD_CT_RUNE_T_, unsigned long)); +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_)); |