Commit f6d15cfc authored by cremno's avatar cremno

fix ISBLANK() for Visual Studio < 2013 (ref #2658)

Visual Studio versions older than 2013 lack C99's isblank().
Since only ASCII characters are passed to it, implement it
directly without calling the locale-specific isblank().
parent 260cad68
...@@ -359,7 +359,7 @@ MRB_API mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self); ...@@ -359,7 +359,7 @@ MRB_API mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self);
#define ISALPHA(c) (ISASCII(c) && isalpha((int)(unsigned char)(c))) #define ISALPHA(c) (ISASCII(c) && isalpha((int)(unsigned char)(c)))
#define ISDIGIT(c) (ISASCII(c) && isdigit((int)(unsigned char)(c))) #define ISDIGIT(c) (ISASCII(c) && isdigit((int)(unsigned char)(c)))
#define ISXDIGIT(c) (ISASCII(c) && isxdigit((int)(unsigned char)(c))) #define ISXDIGIT(c) (ISASCII(c) && isxdigit((int)(unsigned char)(c)))
#define ISBLANK(c) (ISASCII(c) && isblank((int)(unsigned char)(c))) #define ISBLANK(c) (ISASCII(c) && ((c) == ' ' || (c) == '\t'))
#define ISCNTRL(c) (ISASCII(c) && iscntrl((int)(unsigned char)(c))) #define ISCNTRL(c) (ISASCII(c) && iscntrl((int)(unsigned char)(c)))
#define TOUPPER(c) (ISASCII(c) ? toupper((int)(unsigned char)(c)) : (c)) #define TOUPPER(c) (ISASCII(c) ? toupper((int)(unsigned char)(c)) : (c))
#define TOLOWER(c) (ISASCII(c) ? tolower((int)(unsigned char)(c)) : (c)) #define TOLOWER(c) (ISASCII(c) ? tolower((int)(unsigned char)(c)) : (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