diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-02-05 15:36:08 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-02-09 10:13:59 -0700 |
commit | 67addccf238c3d67d84f7dc1f5b4a2e791bf68da (patch) | |
tree | 2d2735f5a0e41ec9baa00395f18f1334965a726a /handy.h | |
parent | 07315176ac6b656ebc6d789680513408aaa17075 (diff) | |
download | perl-67addccf238c3d67d84f7dc1f5b4a2e791bf68da.tar.gz |
Allow [[:blank:]] to work under locale
This takes advantage of the recently added Configure probe, and if the
platform has an isblank library function, calls that under locale. This
now matches the documentation
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -812,6 +812,7 @@ EXTCONST U32 PL_charclass[]; (NXIsAlpha((unsigned int)(c)) || (char)(c) == '_') # define isALPHA_LC(c) NXIsAlpha((unsigned int)(c)) # define isASCII_LC(c) isASCII((unsigned int)(c)) +# define isBLANK_LC(c) isBLANK((unsigned int)(c)) # define isSPACE_LC(c) NXIsSpace((unsigned int)(c)) # define isDIGIT_LC(c) NXIsDigit((unsigned int)(c)) # define isUPPER_LC(c) NXIsUpper((unsigned int)(c)) @@ -840,6 +841,11 @@ EXTCONST U32 PL_charclass[]; # else # define isASCII_LC(c) isASCII((unsigned char)(c)) # endif +# ifdef HAS_ISBLANK +# define isBLANK_LC(c) isblank((unsigned char)(c)) +# else +# define isBLANK_LC(c) isBLANK((unsigned char)(c)) +# endif # define isSPACE_LC(c) isspace((unsigned char)(c)) # define isDIGIT_LC(c) isdigit((unsigned char)(c)) # define isUPPER_LC(c) isupper((unsigned char)(c)) @@ -858,6 +864,11 @@ EXTCONST U32 PL_charclass[]; # define isIDFIRST_LC(c) (isascii(c) && (isalpha(c) || (c) == '_')) # define isALPHA_LC(c) (isascii(c) && isalpha(c)) # define isASCII_LC(c) isascii(c) +# ifdef HAS_ISBLANK +# define isBLANK_LC(c) (isascii(c) && isblank(c)) +# else +# define isBLANK_LC(c) isBLANK(c) +# endif # define isSPACE_LC(c) (isascii(c) && isspace(c)) # define isDIGIT_LC(c) (isascii(c) && isdigit(c)) # define isUPPER_LC(c) (isascii(c) && isupper(c)) @@ -874,7 +885,6 @@ EXTCONST U32 PL_charclass[]; #endif /* USE_NEXT_CTYPE */ #define isPSXSPC_LC(c) (isSPACE_LC(c) || (c) == '\v') -#define isBLANK_LC(c) isBLANK(c) /* could be wrong */ /* For use in the macros just below. If the input is Latin1, use the Latin1 * (_L1) version of the macro; otherwise use the function. Won't compile if |