XS() was changed to imply static linkage - adapt
Florian Ragwitz [Sun, 21 Aug 2011 23:00:21 +0000 (01:00 +0200)]
There's a new XS_EXTERNAL to provide the old XS() semantics. ExtUtils::ParseXS
3.03_02 provides XS_EXTERNAL for compatibility with older perls.

dist.ini
mop.c
mop.h
xs/Moose.xs

index 3fa7f03..6de62c6 100644 (file)
--- a/dist.ini
+++ b/dist.ini
@@ -70,6 +70,9 @@ directory = benchmarks
 
 [CheckChangesHasContent]
 
+[Prereqs / BuildRequires]
+ExtUtils::ParseXS = 3.03_02
+
 [Prereqs]
 Data::OptList               = 0.107
 Devel::GlobalDestruction    = 0
diff --git a/mop.c b/mop.c
index 71c043f..5b14f8f 100644 (file)
--- a/mop.c
+++ b/mop.c
@@ -246,7 +246,7 @@ mop_prehash_keys ()
     }
 }
 
-XS(mop_xs_simple_reader)
+XS_EXTERNAL(mop_xs_simple_reader)
 {
 #ifdef dVAR
     dVAR; dXSARGS;
diff --git a/mop.h b/mop.h
index 5547745..6dcd91d 100644 (file)
--- a/mop.h
+++ b/mop.h
 #define NEED_sv_2pv_nolen
 #include "ppport.h"
 
+/* In theory, ExtUtils::ParseXS provide backcompat for this. However, the only
+ * available version doing that right now is 3.03_02, which is a dev release. We
+ * don't want to depend on dev releases, so we copy the code here. It should be
+ * removed once there's a stable ExtUtils::ParseXS version newer than 3.03_02. */
+#ifndef XS_EXTERNAL
+#  define XS_EXTERNAL XS
+#endif
+
 #define MOP_CALL_BOOT(name)  mop_call_xs(aTHX_ name, cv, mark);
 
 #ifndef XSPROTO
-#define XSPROTO(name) XS(name)
+#define XSPROTO(name) XS_EXTERNAL(name)
 #endif
 
 void mop_call_xs (pTHX_ XSPROTO(subaddr), CV *cv, SV **mark);
@@ -69,7 +77,7 @@ U32 mop_prehashed_hash_for (mop_prehashed_key_t key);
         CvXSUBANY(cv).any_i32 = KEY_ ##key; \
     }
 
-XS(mop_xs_simple_reader);
+XS_EXTERNAL(mop_xs_simple_reader);
 
 extern SV *mop_method_metaclass;
 extern SV *mop_associated_metaclass;
index 8005d1a..ce0ddbf 100644 (file)
@@ -111,17 +111,17 @@ is_regexp (pTHX_ SV* sv) {
 }
 #endif
 
-EXTERN_C XS(boot_Class__MOP);
-EXTERN_C XS(boot_Class__MOP__Mixin__HasAttributes);
-EXTERN_C XS(boot_Class__MOP__Mixin__HasMethods);
-EXTERN_C XS(boot_Class__MOP__Package);
-EXTERN_C XS(boot_Class__MOP__Mixin__AttributeCore);
-EXTERN_C XS(boot_Class__MOP__Method);
-EXTERN_C XS(boot_Class__MOP__Method__Inlined);
-EXTERN_C XS(boot_Class__MOP__Method__Generated);
-EXTERN_C XS(boot_Class__MOP__Class);
-EXTERN_C XS(boot_Class__MOP__Attribute);
-EXTERN_C XS(boot_Class__MOP__Instance);
+XS_EXTERNAL(boot_Class__MOP);
+XS_EXTERNAL(boot_Class__MOP__Mixin__HasAttributes);
+XS_EXTERNAL(boot_Class__MOP__Mixin__HasMethods);
+XS_EXTERNAL(boot_Class__MOP__Package);
+XS_EXTERNAL(boot_Class__MOP__Mixin__AttributeCore);
+XS_EXTERNAL(boot_Class__MOP__Method);
+XS_EXTERNAL(boot_Class__MOP__Method__Inlined);
+XS_EXTERNAL(boot_Class__MOP__Method__Generated);
+XS_EXTERNAL(boot_Class__MOP__Class);
+XS_EXTERNAL(boot_Class__MOP__Attribute);
+XS_EXTERNAL(boot_Class__MOP__Instance);
 
 MODULE = Moose  PACKAGE = Moose::Exporter