summaryrefslogtreecommitdiff
path: root/makedef.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-10-02 18:30:44 -0600
committerKarl Williamson <khw@cpan.org>2022-10-18 06:22:16 -0600
commit7de8159af380f738facd9db4aa5455f02ba5af04 (patch)
tree5f888c19c342521dd6ffcb3aa2d4445ca9b3317f /makedef.pl
parentd52dd969e613d078943e8c99baec94ae5c4aef53 (diff)
downloadperl-7de8159af380f738facd9db4aa5455f02ba5af04.tar.gz
Clean up perl.h/makedef.pl common logic
This has gotten two twisty little mazy over time. Clean it up, add comments, and make sure the logic is the same on both.
Diffstat (limited to 'makedef.pl')
-rw-r--r--makedef.pl41
1 files changed, 27 insertions, 14 deletions
diff --git a/makedef.pl b/makedef.pl
index 36ae63e06b..6aabe7a046 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -107,6 +107,7 @@ while (<CFG>) {
}
close(CFG);
+#==========================================================================
# perl.h logic duplication begins
if ($define{USE_ITHREADS}) {
@@ -143,33 +144,45 @@ 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}) {
+
+if ( $define{HAS_POSIX_2008_LOCALE}
+ && ( ! $define{HAS_SETLOCALE} || ( $define{USE_LOCALE_THREADS}
+ && ! $define{NO_POSIX_2008_LOCALE})))
+{
$define{USE_POSIX_2008_LOCALE} = 1;
- $define{USE_THREAD_SAFE_LOCALE} = 1;
}
-elsif ( ($define{USE_LOCALE_THREADS} || $define{USE_THREAD_SAFE_LOCALE})
- && ( $define{HAS_POSIX_2008_LOCALE}
- || ($ARGS{PLATFORM} eq 'win32' && ( $cctype !~ /\D/
- && $cctype >= 80)))
- && ! $define{NO_THREAD_SAFE_LOCALE})
+
+if ($define{USE_LOCALE_THREADS} && ! $define{NO_THREAD_SAFE_LOCALE})
+{
+ if ( $define{USE_POSIX_2008_LOCALE}
+ || ($ARGS{PLATFORM} eq 'win32' && ( $cctype !~ /\D/
+ && $cctype >= 80)))
+ {
+ $define{USE_THREAD_SAFE_LOCALE} = 1;
+ }
+}
+
+if ($define{USE_POSIX_2008_LOCALE} && $define{HAS_QUERYLOCALE})
{
- $define{USE_THREAD_SAFE_LOCALE} = 1 unless $define{USE_THREAD_SAFE_LOCALE};
- $define{USE_POSIX_2008_LOCALE} = 1 if $define{HAS_POSIX_2008_LOCALE};
+ $define{USE_QUERYLOCALE} = 1;
+
+ # Don't need glibc only code from perl.h
}
-if ( ($define{USE_POSIX_2008_LOCALE} && ! $define{HAS_QUERYLOCALE}))
+if ($define{USE_POSIX_2008_LOCALE} && ! $define{USE_QUERYLOCALE})
{
$define{USE_PL_CURLOCALES} = 1;
}
-if ( $ARGS{PLATFORM} eq 'win32'
- && $define{USE_THREAD_SAFE_LOCALE}
- && $cctype < 140)
+if ($ARGS{PLATFORM} eq 'win32' && $define{USE_THREAD_SAFE_LOCALE})
{
- $define{TS_W32_BROKEN_LOCALECONV} = 1;
+ if ($cctype < 140) {
+ $define{TS_W32_BROKEN_LOCALECONV} = 1;
+ }
}
# perl.h logic duplication ends
+#==========================================================================
print STDERR "Defines: (" . join(' ', sort keys %define) . ")\n"
unless $ARGS{PLATFORM} eq 'test';