This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Need threads to use cur_locale obj
authorKarl Williamson <khw@cpan.org>
Sat, 8 Apr 2023 13:52:18 +0000 (07:52 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 10 Jul 2023 13:36:06 +0000 (07:36 -0600)
On Configurations that are very unlikely to be seen in the wild, these
bits of code were attempted to be compiled when they weren't actually
needed, leading to undefined symbols compilation errors.

The configuration basically involved requiring the POSIX 2008 locale
thread-safe API when no threads are in use.

locale.c
perl.c

index 55c0af0..99c7918 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -7285,7 +7285,7 @@ Perl_thread_locale_term(pTHX)
      * they affect libc's knowledge of the thread; libc has no knowledge of
      * aTHX */
 
-#ifdef USE_POSIX_2008_LOCALE
+#if defined(USE_POSIX_2008_LOCALE) && defined(USE_THREADS)
 
     /* C starts the new thread in the global C locale.  If we are thread-safe,
      * we want to not be in the global locale */
diff --git a/perl.c b/perl.c
index a8d92ae..5def0d7 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1128,7 +1128,7 @@ perl_destruct(pTHXx)
         PL_curlocales[i] = NULL;
     }
 #endif
-#ifdef USE_POSIX_2008_LOCALE
+#if defined(USE_POSIX_2008_LOCALE) && defined(USE_THREADS)
     {
         /* This also makes sure we aren't using a locale object that gets freed
          * below */