]> git.vpit.fr Git - perl/modules/indirect.git/commitdiff
Introduce I_FORKSAFE
authorVincent Pit <vince@profvince.com>
Fri, 28 Aug 2009 18:22:32 +0000 (20:22 +0200)
committerVincent Pit <vince@profvince.com>
Fri, 28 Aug 2009 18:29:43 +0000 (20:29 +0200)
Makefile.PL
indirect.xs
lib/indirect.pm

index b9279479f76f2c58a499ee650198e5bed62e5b5a..2a617fa5377e173bbcf6bb294229fcba5c05e2b5 100644 (file)
@@ -11,6 +11,11 @@ if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
  push @DEFINES, '-DI_MULTIPLICITY=0';
 }
 
  push @DEFINES, '-DI_MULTIPLICITY=0';
 }
 
+# Fork emulation got "fixed" in 5.10.1
+if ($^O eq 'MSWin32' && $^V lt v5.10.1) {
+ push @DEFINES, '-DI_FORKSAFE=0';
+}
+
 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
 
 my $dist = 'indirect';
 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
 
 my $dist = 'indirect';
index 3f5a8cc7783a7d380dbc6beeb67c54cbe72103a2..67eea50401675cbaa32932dde88970c9b99dc725 100644 (file)
 
 /* ... Thread safety and multiplicity ...................................... */
 
 
 /* ... 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
 #ifndef I_MULTIPLICITY
 # if defined(MULTIPLICITY) || defined(PERL_IMPLICIT_CONTEXT)
 #  define I_MULTIPLICITY 1
@@ -857,6 +862,7 @@ BOOT:
 
   stash = gv_stashpvn(__PACKAGE__, __PACKAGE_LEN__, 1);
   newCONSTSUB(stash, "I_THREADSAFE", newSVuv(I_THREADSAFE));
 
   stash = gv_stashpvn(__PACKAGE__, __PACKAGE_LEN__, 1);
   newCONSTSUB(stash, "I_THREADSAFE", newSVuv(I_THREADSAFE));
+  newCONSTSUB(stash, "I_FORKSAFE",   newSVuv(I_FORKSAFE));
  }
 
  indirect_setup();
  }
 
  indirect_setup();
index 7c2bab120e97667ef656be5f767e279efa1ab440..34920db30092002a79bbf1a6b8282c91b0f8612d 100644 (file)
@@ -61,6 +61,7 @@ BEGIN {
  if ($ENV{PERL_INDIRECT_PM_DISABLE}) {
   *_tag = sub ($) { 1 };
   *I_THREADSAFE = sub () { 1 };
  if ($ENV{PERL_INDIRECT_PM_DISABLE}) {
   *_tag = sub ($) { 1 };
   *I_THREADSAFE = sub () { 1 };
+  *I_FORKSAFE   = sub () { 1 };
  } else {
   require XSLoader;
   XSLoader::load(__PACKAGE__, $VERSION);
  } else {
   require XSLoader;
   XSLoader::load(__PACKAGE__, $VERSION);
@@ -148,6 +149,11 @@ sub msg {
 
 True iff the module could have been built with thread-safety features enabled.
 
 
 True iff the module could have been built with thread-safety features enabled.
 
+=head2 C<I_FORKSAFE>
+
+True iff this module could have been built with fork-safety features enabled.
+This will always be true except on Windows where it's false for perl 5.10.0 and below .
+
 =head1 DIAGNOSTICS
 
 =head2 C<Indirect call of method "%s" on object "%s" at %s line %d.>
 =head1 DIAGNOSTICS
 
 =head2 C<Indirect call of method "%s" on object "%s" at %s line %d.>