Commit c4c47069 authored by cremno's avatar cremno

implement `ISASCII` correctly

parent b1dd57ef
...@@ -334,8 +334,7 @@ mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self); ...@@ -334,8 +334,7 @@ mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self);
/* need to include <ctype.h> to use these macros */ /* need to include <ctype.h> to use these macros */
#ifndef ISPRINT #ifndef ISPRINT
/* #define ISASCII(c) isascii((int)(unsigned char)(c)) */ #define ISASCII(c) (!(((int)(unsigned char)(c)) & ~0x7f))
#define ISASCII(c) 1
#define ISPRINT(c) (ISASCII(c) && isprint((int)(unsigned char)(c))) #define ISPRINT(c) (ISASCII(c) && isprint((int)(unsigned char)(c)))
#define ISSPACE(c) (ISASCII(c) && isspace((int)(unsigned char)(c))) #define ISSPACE(c) (ISASCII(c) && isspace((int)(unsigned char)(c)))
#define ISUPPER(c) (ISASCII(c) && isupper((int)(unsigned char)(c))) #define ISUPPER(c) (ISASCII(c) && isupper((int)(unsigned char)(c)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment