X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=handy.h;h=2077007b4c4d59ab515319331d0224d5052242ad;hb=edc2eac33c792d54399e570820645265bcb07080;hp=be0454b22cf43e4fc3a753b8fa4863aca7ca28a3;hpb=eb1102fcca2230364ceadea29bd8e87ee51b15fa;p=p5sagit%2Fp5-mst-13.2.git diff --git a/handy.h b/handy.h index be0454b..2077007 100644 --- a/handy.h +++ b/handy.h @@ -174,7 +174,11 @@ typedef U64TYPE U64; #define I32_MAX INT32_MAX #define I32_MIN INT32_MIN -#define U32_MAX UINT32_MAX +#ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */ +# define U32_MAX UINT32_MAX +#else +# define U32_MAX 4294967295U +#endif #define U32_MIN UINT32_MIN #else @@ -456,7 +460,10 @@ Converts the specified character to lowercase. #define isBLANK_LC_uni(c) isBLANK(c) /* could be wrong */ #define isALNUM_utf8(p) is_utf8_alnum(p) -#define isIDFIRST_utf8(p) is_utf8_idfirst(p) +/* The ID_Start of Unicode is quite limiting: it assumes a L-class + * character (meaning that you cannot have, say, a CJK character). + * Instead, let's allow ID_Continue but not digits. */ +#define isIDFIRST_utf8(p) (is_utf8_idcont(p) && !is_utf8_digit(p)) #define isALPHA_utf8(p) is_utf8_alpha(p) #define isSPACE_utf8(p) is_utf8_space(p) #define isDIGIT_utf8(p) is_utf8_digit(p)