]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - indirect.xs
Introduce I_FORKSAFE
[perl/modules/indirect.git] / indirect.xs
index 53cff20b16bddf792a5d0245cd10e7ab317fb807..67eea50401675cbaa32932dde88970c9b99dc725 100644 (file)
 
 /* ... Thread safety and multiplicity ...................................... */
 
+/* Safe unless stated otherwise in Makefile.PL */
+#ifndef I_FORKSAFE
+# define I_FORKSAFE 1
+#endif
+
 #ifndef I_MULTIPLICITY
 # if defined(MULTIPLICITY) || defined(PERL_IMPLICIT_CONTEXT)
 #  define I_MULTIPLICITY 1
@@ -768,7 +773,6 @@ done:
 STATIC U32 indirect_initialized = 0;
 
 STATIC void indirect_teardown(pTHX_ void *root) {
-#define indirect_teardown() indirect_teardown(aTHX)
  dMY_CXT;
 
  if (!indirect_initialized)
@@ -858,6 +862,7 @@ BOOT:
 
   stash = gv_stashpvn(__PACKAGE__, __PACKAGE_LEN__, 1);
   newCONSTSUB(stash, "I_THREADSAFE", newSVuv(I_THREADSAFE));
+  newCONSTSUB(stash, "I_FORKSAFE",   newSVuv(I_FORKSAFE));
  }
 
  indirect_setup();