From: Vincent Pit Date: Mon, 29 Sep 2008 19:16:22 +0000 (+0200) Subject: Disable thread safety for 5.8.x on Windows X-Git-Tag: v0.22~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=3d0d76b6305e2053de8a95afa896b2d72d5844be Disable thread safety for 5.8.x on Windows --- diff --git a/Magic.xs b/Magic.xs index 2883f00..3622e90 100644 --- a/Magic.xs +++ b/Magic.xs @@ -38,13 +38,15 @@ # define dNOOP #endif -#if defined(MULTIPLICITY) || defined(PERL_IMPLICIT_CONTEXT) -# define VMG_MULTIPLICITY 1 -# ifndef tTHX -# define tTHX PerlInterpreter* +#ifndef VMG_MULTIPLICITY +# if defined(MULTIPLICITY) || defined(PERL_IMPLICIT_CONTEXT) +# define VMG_MULTIPLICITY 1 +# else +# define VMG_MULTIPLICITY 0 # endif -#else -# define VMG_MULTIPLICITY 0 +#endif +#if VMG_MULTIPLICITY && !defined(tTHX) +# define tTHX PerlInterpreter* #endif #if VMG_MULTIPLICITY && defined(dMY_CXT) && defined(MY_CXT) && defined(START_MY_CXT) && defined(MY_CXT_INIT) && (defined(MY_CXT_CLONE) || defined(dMY_CXT_SV)) diff --git a/Makefile.PL b/Makefile.PL index 18cf91c..cc205cb 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -37,6 +37,11 @@ if ($^O eq 'MSWin32' && $^V ge v5.8.7 && $^V lt v5.9.0) { } print $is_as ? "yes\n" : "no\n"; +# Threads, Windows and 5.8.x don't seem to be best friends +if ($^O eq 'MSWin32' && $^V lt v5.9.0) { + push @DEFINES, '-DVMG_MULTIPLICITY=0'; +} + @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES; my $BUILD_REQUIRES = {