Solve the <runetype.h> pollution problem by disabling inline

optimizations when a standard has been requested, except when the
inline optimizations are also specifically requested.
This commit is contained in:
Mike Barcroft 2002-09-09 05:38:05 +00:00
parent 3b257bf450
commit 86eedb4ef4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103113
2 changed files with 32 additions and 8 deletions

View File

@ -45,10 +45,8 @@
#ifndef _CTYPE_H_
#define _CTYPE_H_
/*
* XXX <runetype.h> brings namespace pollution (struct member names).
*/
#include <runetype.h>
#include <sys/cdefs.h>
#include <sys/_types.h>
#define _CTYPE_A 0x00000100L /* Alpha */
#define _CTYPE_C 0x00000200L /* Control */
@ -163,11 +161,25 @@ __END_DECLS
#define __inline
#endif
/*
* <runetype.h> 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 <runetype.h>
static __inline int
__maskrune(__ct_rune_t _c, unsigned long _f)
{

View File

@ -45,10 +45,8 @@
#ifndef _CTYPE_H_
#define _CTYPE_H_
/*
* XXX <runetype.h> brings namespace pollution (struct member names).
*/
#include <runetype.h>
#include <sys/cdefs.h>
#include <sys/_types.h>
#define _CTYPE_A 0x00000100L /* Alpha */
#define _CTYPE_C 0x00000200L /* Control */
@ -163,11 +161,25 @@ __END_DECLS
#define __inline
#endif
/*
* <runetype.h> 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 <runetype.h>
static __inline int
__maskrune(__ct_rune_t _c, unsigned long _f)
{