Browse Source

add macro version of ctype.h isascii function

presumably internal code (ungetwc and fputwc) was written assuming a
macro implementation existed; otherwise use of isascii is just a
pessimization.
Rich Felker 9 years ago
parent
commit
3d7e32d28d
2 changed files with 2 additions and 0 deletions
  1. 1 0
      include/ctype.h
  2. 1 0
      src/ctype/isascii.c

+ 1 - 0
include/ctype.h

@@ -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
 

+ 1 - 0
src/ctype/isascii.c

@@ -1,4 +1,5 @@
 #include <ctype.h>
+#undef isascii
 
 int isascii(int c)
 {