Skip to content

Commit

Permalink
makedef.pl: Don't use locale items unless using locale
Browse files Browse the repository at this point in the history
If we are configured to not look at locales at all, we shouldn't be
looking at threaded locales nor POSIX 2008 ones.

This commit fixes a situation that is not likely at all to show up in
real life, but I stumbled across it in testing weird configurations.
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent 35144f7 commit 8cbafb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion makedef.pl
Expand Up @@ -156,11 +156,15 @@ BEGIN

# 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}) {
if ( $define{USE_ITHREADS}
&& $define{USE_LOCALE}
&& ! $define{NO_LOCALE_THREADS})
{
$define{USE_LOCALE_THREADS} = 1;
}

if ( $define{HAS_POSIX_2008_LOCALE}
&& $define{USE_LOCALE}
&& (! $define{HAS_SETLOCALE} || ( $define{USE_LOCALE_THREADS}
&& ! $define{NO_POSIX_2008_LOCALE})
&& ! $define{NO_THREAD_SAFE_LOCALE}))
Expand Down

0 comments on commit 8cbafb8

Please sign in to comment.