summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-10-17 06:55:50 -0600
committerKarl Williamson <khw@cpan.org>2020-11-22 20:06:03 -0700
commitc62fdeb784c7643c90d2ea8c2ec0f03a548da338 (patch)
tree9c5f6ad7fe164633a5a8667402320e12d2755b45 /handy.h
parent8dff134de1f0dc51682889d5cf8c25ab7c31bf45 (diff)
downloadperl-c62fdeb784c7643c90d2ea8c2ec0f03a548da338.tar.gz
Restrict scope/Shorten some very long macro names
The names were intended to force people to not use them outside their intended scopes. But by restricting those scopes in the first place, we don't need such unwieldy names
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/handy.h b/handy.h
index 7feedcb792..96f84fa5d1 100644
--- a/handy.h
+++ b/handy.h
@@ -1616,16 +1616,21 @@ END_EXTERN_C
# endif
/* Participates in a single-character fold with a character above 255 */
-# define _HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) ((! cBOOL(FITS_IN_8_BITS(c))) || (PL_charclass[(U8) (c)] & _CC_mask(_CC_NONLATIN1_SIMPLE_FOLD)))
+# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C)
+# define HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(c) \
+ (( ! cBOOL(FITS_IN_8_BITS(c))) \
+ || (PL_charclass[(U8) (c)] & _CC_mask(_CC_NONLATIN1_SIMPLE_FOLD)))
+
+# define IS_NON_FINAL_FOLD(c) _generic_isCC(c, _CC_NON_FINAL_FOLD)
+# define IS_IN_SOME_FOLD_L1(c) _generic_isCC(c, _CC_IS_IN_SOME_FOLD)
+# endif
/* Like the above, but also can be part of a multi-char fold */
-# define _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) ((! cBOOL(FITS_IN_8_BITS(c))) || (PL_charclass[(U8) (c)] & _CC_mask(_CC_NONLATIN1_FOLD)))
+# define HAS_NONLATIN1_FOLD_CLOSURE(c) \
+ ( (! cBOOL(FITS_IN_8_BITS(c))) \
+ || (PL_charclass[(U8) (c)] & _CC_mask(_CC_NONLATIN1_FOLD)))
# define _isQUOTEMETA(c) _generic_isCC(c, _CC_QUOTEMETA)
-# define _IS_NON_FINAL_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C(c) \
- _generic_isCC(c, _CC_NON_FINAL_FOLD)
-# define _IS_IN_SOME_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C(c) \
- _generic_isCC(c, _CC_IS_IN_SOME_FOLD)
/* is c a control character for which we have a mnemonic? */
# if defined(PERL_CORE) || defined(PERL_EXT)