diff --git a/include/_ctype.h b/include/_ctype.h index 8cf6b56e781d..7d6fa79d3269 100644 --- a/include/_ctype.h +++ b/include/_ctype.h @@ -45,10 +45,8 @@ #ifndef _CTYPE_H_ #define _CTYPE_H_ -/* - * XXX brings namespace pollution (struct member names). - */ -#include +#include +#include #define _CTYPE_A 0x00000100L /* Alpha */ #define _CTYPE_C 0x00000200L /* Control */ @@ -163,11 +161,25 @@ __END_DECLS #define __inline #endif +/* + * brings namespace pollution (struct member names). This prevents + * us from using the inline optimizations in the more strict __POSIX_VISIBLE and + * __XSI_VISIBLE namespaces. To fix this properly would require that we rename + * member names of long-standing structs, or something equally evil. + */ +#if !__BSD_VISIBLE && !defined(_USE_CTYPE_INLINE_) && \ + !defined(_DONT_USE_CTYPE_INLINE_) +#define _DONT_USE_CTYPE_INLINE_ +#endif + /* * Use inline functions if we are allowed to and the compiler supports them. */ #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +#include + static __inline int __maskrune(__ct_rune_t _c, unsigned long _f) { diff --git a/include/ctype.h b/include/ctype.h index 8cf6b56e781d..7d6fa79d3269 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -45,10 +45,8 @@ #ifndef _CTYPE_H_ #define _CTYPE_H_ -/* - * XXX brings namespace pollution (struct member names). - */ -#include +#include +#include #define _CTYPE_A 0x00000100L /* Alpha */ #define _CTYPE_C 0x00000200L /* Control */ @@ -163,11 +161,25 @@ __END_DECLS #define __inline #endif +/* + * brings namespace pollution (struct member names). This prevents + * us from using the inline optimizations in the more strict __POSIX_VISIBLE and + * __XSI_VISIBLE namespaces. To fix this properly would require that we rename + * member names of long-standing structs, or something equally evil. + */ +#if !__BSD_VISIBLE && !defined(_USE_CTYPE_INLINE_) && \ + !defined(_DONT_USE_CTYPE_INLINE_) +#define _DONT_USE_CTYPE_INLINE_ +#endif + /* * Use inline functions if we are allowed to and the compiler supports them. */ #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +#include + static __inline int __maskrune(__ct_rune_t _c, unsigned long _f) {