summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-02-21 13:26:49 -0700
committerKarl Williamson <public@khwilliamson.com>2013-08-29 09:55:54 -0600
commitefa6106c8d6f8f62cd560a5c71a98797883d8f08 (patch)
tree5a6241eb49623e93c446eabab22809c1c61fe2fb /handy.h
parent3d81eea60b810797ecb1123661164802c8a1984b (diff)
downloadperl-efa6106c8d6f8f62cd560a5c71a98797883d8f08.tar.gz
handy.h: Combine macros that are same in ASCII, EBCDIC
These 4 macros can have the same RHS for their ASCII and EBCDIC versions, so no need to duplicate their definitions This also enables the EBCDIC versions to not have undefined expansions when compiling without perl.h
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/handy.h b/handy.h
index 7b6db333df..e0c00b8acc 100644
--- a/handy.h
+++ b/handy.h
@@ -1028,33 +1028,30 @@ EXTCONST U32 PL_charclass[];
# define _IS_IN_SOME_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C(c) \
_generic_isCC(c, _CC_IS_IN_SOME_FOLD)
#else /* No perl.h. */
+# define isBLANK_A(c) ((c) == ' ' || (c) == '\t')
+# define isIDFIRST_A(c) (isALPHA_A(c) || (c) == '_')
+# define isWORDCHAR_A(c) (isALPHANUMERIC_A(c) || (c) == '_')
+# define isPSXSPC_A(c) (isSPACE_A(c) || (c) == '\v')
# ifdef EBCDIC
# define isALPHA_A(c) (isASCII(c) && isALPHA(c))
# define isALPHANUMERIC_A(c) (isASCII(c) && isALPHANUMERIC(c))
-# define isBLANK_A(c) (isASCII(c) && isBLANK(c))
# define isCNTRL_A(c) (isASCII(c) && isCNTRL(c))
# define isDIGIT_A(c) (isASCII(c) && isDIGIT(c))
# define isGRAPH_A(c) (isASCII(c) && isGRAPH(c))
-# define isIDFIRST_A(c) (isASCII(c) && isIDFIRST(c))
# define isLOWER_A(c) (isASCII(c) && isLOWER(c))
# define isPRINT_A(c) (isASCII(c) && isPRINT(c))
-# define isPSXSPC_A(c) (isASCII(c) && isPSXSPC(c))
# define isPUNCT_A(c) (isASCII(c) && isPUNCT(c))
# define isSPACE_A(c) (isASCII(c) && isSPACE(c))
# define isUPPER_A(c) (isASCII(c) && isUPPER(c))
-# define isWORDCHAR_A(c) (isASCII(c) && isWORDCHAR(c))
# define isXDIGIT_A(c) (isASCII(c) && isXDIGIT(c))
# else /* ASCII platform, no perl.h */
# define isALPHA_A(c) (isUPPER_A(c) || isLOWER_A(c))
# define isALPHANUMERIC_A(c) (isALPHA_A(c) || isDIGIT_A(c))
-# define isBLANK_A(c) ((c) == ' ' || (c) == '\t')
# define isCNTRL_A(c) (FITS_IN_8_BITS(c) && ((U8) (c) < ' ' || (c) == 127))
# define isDIGIT_A(c) ((c) <= '9' && (c) >= '0')
# define isGRAPH_A(c) (isWORDCHAR_A(c) || isPUNCT_A(c))
-# define isIDFIRST_A(c) (isALPHA_A(c) || (c) == '_')
# define isLOWER_A(c) ((c) >= 'a' && (c) <= 'z')
# define isPRINT_A(c) (((c) >= 32 && (c) < 127))
-# define isPSXSPC_A(c) (isSPACE_A(c) || (c) == '\v')
# define isPUNCT_A(c) (((c) >= 33 && (c) <= 47) \
|| ((c) >= 58 && (c) <= 64) \
|| ((c) >= 91 && (c) <= 96) \
@@ -1065,7 +1062,6 @@ EXTCONST U32 PL_charclass[];
|| (c) =='\r' \
|| (c) == '\f')
# define isUPPER_A(c) ((c) <= 'Z' && (c) >= 'A')
-# define isWORDCHAR_A(c) (isALPHA_A(c) || isDIGIT_A(c) || (c) == '_')
# define isXDIGIT_A(c) (isDIGIT_A(c) \
|| ((c) >= 'a' && (c) <= 'f') \
|| ((c) <= 'F' && (c) >= 'A'))