@@ -646,13 +646,19 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
646
646
* locales without letting perl know, therefore we have to find it
647
647
* from first principals. See [perl #121930]. */
648
648
649
- /* In windows, or not threaded, or not thread-safe, if it isn't C,
650
- * set it to C. */
651
-
652
- # ifndef USE_POSIX_2008_LOCALE
649
+ # ifdef USE_POSIX_2008_LOCALE
653
650
651
+ /* With POSIX 2008, all we have to do is toggle to the C locale
652
+ * just long enough to get the value (which should have a dot). */
653
+ const locale_t locale_obj_on_entry = uselocale (PL_C_locale_obj );
654
+ GET_NUMERIC_VERSION (ver , sv , tbuf , buf , len );
655
+ uselocale (locale_obj_on_entry );
656
+ # else
654
657
const char * locale_name_on_entry ;
655
658
659
+ /* In windows, or not threaded, or not thread-safe, if it isn't C,
660
+ * set it to C. */
661
+
656
662
LC_NUMERIC_LOCK (0 ); /* Start critical section */
657
663
658
664
locale_name_on_entry = setlocale (LC_NUMERIC , NULL );
@@ -681,13 +687,6 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
681
687
}
682
688
683
689
LC_NUMERIC_UNLOCK ; /* End critical section */
684
-
685
- # else
686
- /* With POSIX 2008, all we have to do is toggle to the C locale
687
- * just long enough to get the value (which should have a dot). */
688
- const locale_t locale_obj_on_entry = uselocale (PL_C_locale_obj );
689
- GET_NUMERIC_VERSION (ver , sv , tbuf , buf , len );
690
- uselocale (locale_obj_on_entry );
691
690
# endif
692
691
693
692
}
0 commit comments