Skip to content

Commit cdd9ba9

Browse files
committed
makedef.pl: Don't use locale items unless using locale
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 stumbeled across it in testing weird configurations.
1 parent 4dbd110 commit cdd9ba9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

makedef.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,15 @@ BEGIN
156156

157157
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
158158
my $cctype = $ARGS{CCTYPE} =~ s/MSVC//r;
159-
if ($define{USE_ITHREADS} && ! $define{NO_LOCALE_THREADS}) {
159+
if ( $define{USE_ITHREADS}
160+
&& $define{USE_LOCALE}
161+
&& ! $define{NO_LOCALE_THREADS})
162+
{
160163
$define{USE_LOCALE_THREADS} = 1;
161164
}
162165

163166
if ( $define{HAS_POSIX_2008_LOCALE}
167+
&& $define{USE_LOCALE}
164168
&& (! $define{HAS_SETLOCALE} || ( $define{USE_LOCALE_THREADS}
165169
&& ! $define{NO_POSIX_2008_LOCALE})
166170
&& ! $define{NO_THREAD_SAFE_LOCALE}))

0 commit comments

Comments
 (0)