add macro version of ctype.h isascii function
authorRich Felker <dalias@aerifal.cx>
Sat, 6 Jun 2015 18:16:22 +0000 (18:16 +0000)
committerRich Felker <dalias@aerifal.cx>
Sat, 6 Jun 2015 18:16:22 +0000 (18:16 +0000)
presumably internal code (ungetwc and fputwc) was written assuming a
macro implementation existed; otherwise use of isascii is just a
pessimization.

include/ctype.h
src/ctype/isascii.c

index cd2e016..7936536 100644 (file)
@@ -64,6 +64,7 @@ int   isascii(int);
 int   toascii(int);
 #define _tolower(a) ((a)|0x20)
 #define _toupper(a) ((a)&0x5f)
+#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
 
 #endif
 
index 3af0a10..54ad3bf 100644 (file)
@@ -1,4 +1,5 @@
 #include <ctype.h>
+#undef isascii
 
 int isascii(int c)
 {