httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: PR 2553 and 2282
Date Tue, 07 Jul 1998 11:41:01 GMT
Sounds reasonable...

Dean Gaudet wrote:
> 
> 
> 
> On Mon, 6 Jul 1998, Dean Gaudet wrote:
> 
> > - since characters are signed on solaris, isspace is broken on 8-bit
> > characters (as are all the ctype macros).  I verified that 2553 and 2282
> > are not a problem if I compile with gcc -funsigned-char.  I really hate
> > goddamn libc legacy. 
> 
> Here's my suggestion for fixing this absurdity:
> 
> - for all the platforms that use gcc, add -funsigned-char.
> 
> - in include/conf.h (or ap.h, whatever):
> 
> /* define HAVE_8BIT_CTYPE if your characters are unsigned, and
>  * your ctype macros understand 8-bit characters.
>  */
> #if defined(HAVE_8BIT_CTYPE)
> #if defined(__GNUC__) && !defined(__CHAR_UNSIGNED__)
> #error "you lie, you forgot -funsigned-char"
> #endif
> #define ap_isascii(c) (1)
> #define ap_tolower(c) (tolower(c))
> #define ap_toupper(c) (toupper(c))
> #else
> #define ap_isascii(c) (isascii(c))
> #define ap_tolower(c) (isascii(c) ? tolower(c) : (c))
> #define ap_toupper(c) (isascii(c) ? tolower(c) : (c))
> #endif
> 
> #define ap_isalnum(c) (isascii(c) && isalnum(c))
> #define ap_isalpha(c) (isascii(c) && isalpha(c))
> #define ap_iscntrl(c) (isascii(c) && iscntrl(c))
> #define ap_isdigit(c) (isascii(c) && isdigit(c))
> #define ap_isgraph(c) (isascii(c) && isgraph(c))
> #define ap_islower(c) (isascii(c) && islower(c))
> #define ap_isprint(c) (isascii(c) && isprint(c))
> #define ap_ispunct(c) (isascii(c) && ispunct(c))
> #define ap_isspace(c) (isascii(c) && isspace(c))
> #define ap_isupper(c) (isascii(c) && isupper(c))
> 
> and replace all occurances everywhere in the code.
> 
> Dean
> 
> 


-- 
===========================================================================
   Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
            "That's no ordinary rabbit... that's the most foul,
            cruel and bad-tempered rodent you ever laid eyes on"

Mime
View raw message