summaryrefslogtreecommitdiff
path: root/dist/ExtUtils-ParseXS
diff options
context:
space:
mode:
authorSteffen Mueller <smueller@cpan.org>2011-08-18 13:20:35 +0200
committerSteffen Mueller <smueller@cpan.org>2011-08-21 13:31:40 +0200
commite9510e8f3503e2751d40cb2d756edb51cc36df08 (patch)
treea48fc883b8c7bafae9571722e8bd5b2b180b481b /dist/ExtUtils-ParseXS
parent7ec04da5b5eb2040fcb41f623e7779acd16563b4 (diff)
downloadperl-e9510e8f3503e2751d40cb2d756edb51cc36df08.tar.gz
Make the use of XS_EXTERNAL fall back to XS
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.
Diffstat (limited to 'dist/ExtUtils-ParseXS')
-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";