This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Use proper #ifdef to enable behavior
authorKarl Williamson <khw@cpan.org>
Thu, 28 Nov 2019 02:18:13 +0000 (19:18 -0700)
committerKarl Williamson <khw@cpan.org>
Sat, 30 Nov 2019 21:20:06 +0000 (14:20 -0700)
This changes to use USE_POSIX_2008_LOCALE instead of
HAS_POSIX_2008_LOCALE.  Rarely do they differ, but someone may choose to
configure their installation to not use these more modern functions,
even if available, perhaps because they're buggy on that system.

locale.c

index 54b51ff..482a533 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -5274,9 +5274,9 @@ Perl_my_strerror(pTHX_ const int errnum)
         Safefree(save_locale);
     }
 
-#  elif defined(HAS_POSIX_2008_LOCALE)                      \
-     && defined(HAS_STRERROR_L)                             \
-     && defined(HAS_DUPLOCALE)
+#  elif   defined(USE_POSIX_2008_LOCALE)                      \
+     &&   defined(HAS_STRERROR_L)                             \
+     &&   defined(HAS_DUPLOCALE)
 
     /* This function is also trivial if we don't have to worry about thread
      * safety and have strerror_l(), as it handles the switch of locales so we