From 4098e5861e4a6dadf17e6502afbc139bcff3cd3b Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 20 Oct 2000 16:37:01 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 8fe1ec99b9..ae55beee32 100644 --- a/parse.y +++ b/parse.y @@ -1820,7 +1820,18 @@ none : /* none */ #include "regex.h" #include "util.h" -#define is_identchar(c) (((int)(c))!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c))) +/* We remove any previous definition of `SIGN_EXTEND_CHAR', + since ours (we hope) works properly with all combinations of + machines, compilers, `char' and `unsigned char' argument types. + (Per Bothner suggested the basic approach.) */ +#undef SIGN_EXTEND_CHAR +#if __STDC__ +# define SIGN_EXTEND_CHAR(c) ((signed char)(c)) +#else /* not __STDC__ */ +/* As in Harbison and Steele. */ +# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128) +#endif +#define is_identchar(c) (SIGN_EXTEND_CHAR(c)!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c))) static char *tokenbuf = NULL; static int tokidx, toksiz = 0; -- cgit v1.2.3