diff options
| author | cremno <[email protected]> | 2014-06-05 20:18:23 +0200 |
|---|---|---|
| committer | cremno <[email protected]> | 2014-06-05 20:18:23 +0200 |
| commit | c4c470696bb11e00e0c920461b03406df245f9c0 (patch) | |
| tree | a37d26a4b0ae957c28e9a2b60f09533232b44513 | |
| parent | b1dd57efa1a1b292021bfe7ba7e4ac14e0b151b9 (diff) | |
| download | mruby-c4c470696bb11e00e0c920461b03406df245f9c0.tar.gz mruby-c4c470696bb11e00e0c920461b03406df245f9c0.zip | |
implement `ISASCII` correctly
| -rw-r--r-- | include/mruby.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/mruby.h b/include/mruby.h index 04ef018cb..390d593bc 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -334,8 +334,7 @@ mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self); /* need to include <ctype.h> to use these macros */ #ifndef ISPRINT -/* #define ISASCII(c) isascii((int)(unsigned char)(c)) */ -#define ISASCII(c) 1 +#define ISASCII(c) (!(((int)(unsigned char)(c)) & ~0x7f)) #define ISPRINT(c) (ISASCII(c) && isprint((int)(unsigned char)(c))) #define ISSPACE(c) (ISASCII(c) && isspace((int)(unsigned char)(c))) #define ISUPPER(c) (ISASCII(c) && isupper((int)(unsigned char)(c))) |
