From 8751a11f7fafc4d656fe8f44ebc8b5233e437153 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 10 Feb 2021 07:09:06 -0700 Subject: Add USE_LOCALE_THREADS #define This is in preparation for supporting configurations where there threads are available, but the locale handling code should ignore that fact. This stems from the unusual locale handling of z/OS, where any attempt is ignored to change locales after the first thread is created. --- makedef.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'makedef.pl') diff --git a/makedef.pl b/makedef.pl index b1663b31e3..f5d98d1be1 100644 --- a/makedef.pl +++ b/makedef.pl @@ -140,11 +140,14 @@ if (! $define{NO_LOCALE}) { # https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering my $cctype = $ARGS{CCTYPE} =~ s/MSVC//r; +if ($define{USE_ITHREADS} && ! $define{NO_LOCALE_THREADS}) { + $define{USE_LOCALE_THREADS} = 1; +} if (! $define{HAS_SETLOCALE} && $define{HAS_POSIX_2008_LOCALE}) { $define{USE_POSIX_2008_LOCALE} = 1; $define{USE_THREAD_SAFE_LOCALE} = 1; } -elsif ( ($define{USE_ITHREADS} || $define{USE_THREAD_SAFE_LOCALE}) +elsif ( ($define{USE_LOCALE_THREADS} || $define{USE_THREAD_SAFE_LOCALE}) && ( $define{HAS_POSIX_2008_LOCALE} || ($ARGS{PLATFORM} eq 'win32' && ( $cctype !~ /\D/ && $cctype >= 80))) @@ -405,8 +408,7 @@ unless ($define{'USE_ITHREADS'}) { ); } -if ( $define{NO_LOCALE} - || (! $define{USE_ITHREADS} && ! $define{USE_THREAD_SAFE_LOCALE})) +unless ($define{USE_POSIX_2008_LOCALE}) { ++$skip{$_} foreach qw( PL_C_locale_obj -- cgit v1.2.1