]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - Valgrind.xs
Fix the dummy XS code for PERL_IMPLICIT_SYS builds
[perl/modules/Test-Valgrind.git] / Valgrind.xs
index b2108a2a58f5915280ce41f7738969777738368a..b4a5a46b52288035afbb3fc962fabf5a988b0606 100644 (file)
 
 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 *