summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2024-09-14 08:37:08 -0400
committerAndrew Dunstan <andrew@dunslane.net>2024-09-14 09:17:51 -0400
commit17c35ab236980fce2989f7fac7cee42ca4d5ca04 (patch)
treec718eae221e10d98ef38a42b79260f82f36e51c9 /src
parente0857898b87b745235e65c28feed6e23e121876d (diff)
Only define NO_THREAD_SAFE_LOCALE for MSVC plperl when required
Latest versions of Strawberry Perl define USE_THREAD_SAFE_LOCALE, and we therefore get a handshake error when building against such instances. The solution is to perform a test to see if USE_THREAD_SAFE_LOCALE is defined and only define NO_THREAD_SAFE_LOCALE if it isn't. Backpatch the meson.build fix back to release 16 and apply the same logic to Mkvcbuild.pm in releases 12 through 16. Original report of the issue from Muralikrishna Bandaru.
Diffstat (limited to 'src')
-rw-r--r--src/tools/msvc/Mkvcbuild.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 990c223a9b4..f86a065375f 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -582,7 +582,9 @@ sub mkvcbuild
push(@perl_embed_ccflags, 'PLPERL_HAVE_UID_GID');
# prevent binary mismatch between MSVC built plperl and
# Strawberry or msys ucrt perl libraries
- push(@perl_embed_ccflags, 'NO_THREAD_SAFE_LOCALE');
+ my $perl_v = `$^X -V 2>&1`;
+ push(@perl_embed_ccflags, 'NO_THREAD_SAFE_LOCALE')
+ unless $perl_v =~ /USE_THREAD_SAFE_LOCALE/;
# Windows offers several 32-bit ABIs. Perl is sensitive to
# sizeof(time_t), one of the ABI dimensions. To get 32-bit time_t,