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 /perl.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 'perl.h')
-rw-r--r-- | perl.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -6918,7 +6918,7 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect. * string, and an end position which it won't try to read past */ # define _CHECK_AND_OUTPUT_WIDE_LOCALE_CP_MSG(cp) \ STMT_START { \ - if (! PL_in_utf8_CTYPE_locale && ckWARN(WARN_LOCALE)) { \ + if (! IN_UTF8_CTYPE_LOCALE && ckWARN(WARN_LOCALE)) { \ Perl_warner(aTHX_ packWARN(WARN_LOCALE), \ "Wide character (U+%" UVXf ") in %s",\ (UV) cp, OP_DESC(PL_op)); \ @@ -6927,7 +6927,7 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect. # define _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG(s, send) \ STMT_START { /* Check if to warn before doing the conversion work */\ - if (! PL_in_utf8_CTYPE_locale && ckWARN(WARN_LOCALE)) { \ + if (! IN_UTF8_CTYPE_LOCALE && ckWARN(WARN_LOCALE)) { \ UV cp = utf8_to_uvchr_buf((U8 *) (s), (U8 *) (send), NULL); \ Perl_warner(aTHX_ packWARN(WARN_LOCALE), \ "Wide character (U+%" UVXf ") in %s", \ |