In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/80306bb6fd3a203fe3583693a061e7cf3bdce42a?hp=929a7f8c537d1238e2a62caff6f9c494010473c7>

- Log -----------------------------------------------------------------
commit 80306bb6fd3a203fe3583693a061e7cf3bdce42a
Author: Karl Williamson <k...@cpan.org>
Date:   Wed Mar 7 10:20:53 2018 -0700

    Don't use duplocale() unless is present
    
    Prior to this patch, the code assumed that if you have the other, more
    significant, POSIX 2008 functions available, that duplocale was present
    and correctly functioning too.
    
    However, we found that there have been bugs in it, so that a hints file
    or Configure probe might want to exclude just it.

-----------------------------------------------------------------------

Summary of changes:
 ext/POSIX/POSIX.xs | 3 ++-
 locale.c           | 7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index cf744c7ecf..bde6234956 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -2154,7 +2154,8 @@ localeconv()
        sv_2mortal((SV*)RETVAL);
 #  if defined(USE_ITHREADS)                         \
    && defined(HAS_POSIX_2008_LOCALE)                \
-   && defined(HAS_LOCALECONV_L)
+   && defined(HAS_LOCALECONV_L)                     \
+   && defined(HAS_DUPLOCALE)
 
         cur = uselocale((locale_t) 0);
         if (cur == LC_GLOBAL_LOCALE) {
diff --git a/locale.c b/locale.c
index cf371738b5..6a4e012954 100644
--- a/locale.c
+++ b/locale.c
@@ -2393,7 +2393,8 @@ S_my_nl_langinfo(const int item, bool toggle)
 
 #if defined(HAS_NL_LANGINFO) /* nl_langinfo() is available.  */
 #  if   ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L)      \
-     || ! defined(HAS_POSIX_2008_LOCALE)
+     || ! defined(HAS_POSIX_2008_LOCALE)              \
+     || ! defined(DUPLOCALE)
 
     /* Here, use plain nl_langinfo(), switching to the underlying LC_NUMERIC
      * for those items dependent on it.  This must be copied to a buffer before
@@ -5032,7 +5033,9 @@ Perl_my_strerror(pTHX_ const int errnum)
         do_setlocale_c(LC_MESSAGES, save_locale);
     }
 
-#  elif defined(HAS_POSIX_2008_LOCALE) && defined(HAS_STRERROR_L)
+#  elif defined(HAS_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

-- 
Perl5 Master Repository

Reply via email to