summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Mueller <smueller@cpan.org>2011-08-18 13:20:35 +0200
committerSteffen Mueller <smueller@cpan.org>2011-08-18 13:20:35 +0200
commite834117c63fd2c9d314f8c7466e54579e3014534 (patch)
tree262b845656a646e55963099318c70ec95f6cc9dd
parent9d34fc58a32fd7baec1972e5fe14e2555f167af0 (diff)
downloadperl-smueller/static_xsub.tar.gz
Make the use of XS_EXTERNAL fall back to XSsmueller/static_xsub
If XSUB.h/perl doesn't define the new XS_EXTERNAL macro that we use for emitting non-static XSUBs for the boot functions, we have XS_EXTERNAL just fall back to the standard XS macro.
-rw-r--r--dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
index 1616b0dc52..7ff73d3fa2 100644
--- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
+++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
@@ -453,6 +453,14 @@ sub standard_XS_defs {
# define PERL_UNUSED_VAR(var) if (0) var = var
#endif
+/* Starting from 5.15.2, XS(name) defines a static function (==internal)
+ * and the XS_EXTERNAL macro is used for functions that must not be static
+ * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
+ * macro defined, the best we can do is assume XS is the same.
+ */
+#ifndef XS_EXTERNAL
+# define XS_EXTERNAL(name) XS(name)
+#endif
EOF
print <<"EOF";