From: Vincent Pit Date: Fri, 30 Oct 2015 15:00:34 +0000 (-0200) Subject: Fix the dummy XS code for PERL_IMPLICIT_SYS builds X-Git-Tag: v1.15~7 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=commitdiff_plain;h=f31dd6e4f7a6dedc9ed34ae60d5e5ad8111a6b03 Fix the dummy XS code for PERL_IMPLICIT_SYS builds --- diff --git a/Valgrind.xs b/Valgrind.xs index b2108a2..b4a5a46 100644 --- a/Valgrind.xs +++ b/Valgrind.xs @@ -18,7 +18,17 @@ const char *tv_leaky = NULL; -extern void tv_leak(void) { +/* malloc() on Windows needs the current interpreter. */ + +#ifdef PERL_IMPLICIT_SYS +# define TV_LEAK_PROTO pTHX +# define TV_LEAK_ARG aTHX +#else +# define TV_LEAK_PROTO void +# define TV_LEAK_ARG +#endif + +extern void tv_leak(TV_LEAK_PROTO) { tv_leaky = malloc(10000); return; @@ -39,7 +49,7 @@ BOOT: void leak() CODE: - tv_leak(); + tv_leak(TV_LEAK_ARG); XSRETURN_UNDEF; SV *