diff options
author | Karl Williamson <khw@cpan.org> | 2022-10-08 06:49:01 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-10-10 13:22:11 -0600 |
commit | f41910bf9320ae3f1312f3e832504e8b03da3f00 (patch) | |
tree | f0d730d52ec211c288eda17a6020e4c41dd35d5d /handy.h | |
parent | 7a615b719074d2537dcc9f9c87ef4b4795182579 (diff) | |
download | perl-f41910bf9320ae3f1312f3e832504e8b03da3f00.tar.gz |
handy.h: Set macro to false if can't ever be true
It's unlikely that perl will be compiled with out the LC_CTYPE locale
category being enabled. But if it isn't, there is no sense in having
per-interpreter variables for various conditions in it, and no sense
having code that tests those variables.
This commit changes a macro to always yield 'false' when this is
disabled, adds a new similar macro, and changes some occurrences that
test for a variable to use the macros instead of the variables. That
way the compiler knows these to conditions can never be true.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1880,7 +1880,13 @@ END_EXTERN_C #define toUPPER_LATIN1_MOD(c) ((! FITS_IN_8_BITS(c)) \ ? (c) \ : PL_mod_latin1_uc[ (U8) (c) ]) -#define IN_UTF8_CTYPE_LOCALE PL_in_utf8_CTYPE_locale +#ifdef USE_LOCALE_CTYPE +# define IN_UTF8_CTYPE_LOCALE PL_in_utf8_CTYPE_locale +# define IN_UTF8_TURKIC_LOCALE PL_in_utf8_turkic_locale +#else +# define IN_UTF8_CTYPE_LOCALE false +# define IN_UTF8_TURKIC_LOCALE false +#endif /* Use foo_LC_uvchr() instead of these for beyond the Latin1 range */ |