From: Vincent Pit Date: Tue, 14 Apr 2015 16:50:58 +0000 (-0300) Subject: Allow disabling thread safety in Makefile.PL X-Git-Tag: v0.57~7 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=432cd8420b1c4c1d963efd13695497095fde9bd0;p=perl%2Fmodules%2FVariable-Magic.git Allow disabling thread safety in Makefile.PL Note that thread safety still cannot be forcefully enabled if the necessary macros are not defined. --- diff --git a/Magic.xs b/Magic.xs index 947ae72..e6c2fdf 100644 --- a/Magic.xs +++ b/Magic.xs @@ -62,7 +62,9 @@ #endif #if VMG_MULTIPLICITY && defined(USE_ITHREADS) && defined(dMY_CXT) && defined(MY_CXT) && defined(START_MY_CXT) && defined(MY_CXT_INIT) && (defined(MY_CXT_CLONE) || defined(dMY_CXT_SV)) -# define VMG_THREADSAFE 1 +# ifndef VMG_THREADSAFE +# define VMG_THREADSAFE 1 +# endif # ifndef MY_CXT_CLONE # define MY_CXT_CLONE \ dMY_CXT_SV; \ @@ -71,6 +73,7 @@ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) # endif #else +# undef VMG_THREADSAFE # define VMG_THREADSAFE 0 # undef dMY_CXT # define dMY_CXT dNOOP