From: Steffen Mueller Date: Sun, 4 Sep 2011 16:55:06 +0000 (+0200) Subject: ExtUtils::ParseXS: Allow users to enforce linkage of XSUBs X-Git-Tag: v5.15.3~229 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/ca0e6506c663785374bf53fcafa07e5029c4a222 ExtUtils::ParseXS: Allow users to enforce linkage of XSUBs ... using defines. For easy backwards-compatibility of XS modules, we allow XS authors to use #define PERL_EUPXS_ALWAYS_EXPORT or #define PERL_EUPXS_NEVER_EXPORT to choose one or the other behaviour. Since "always export" has been the default behaviour of ExtUtils::ParseXS for virtually ever, defining PERL_EUPXS_ALWAYS_EXPORT means that you get that behaviour in a very backwards compatible way (barring a few broken EU::PXS releases). --- diff --git a/dist/ExtUtils-ParseXS/Changes b/dist/ExtUtils-ParseXS/Changes index f4de8ae..0556dfa 100644 --- a/dist/ExtUtils-ParseXS/Changes +++ b/dist/ExtUtils-ParseXS/Changes @@ -1,6 +1,14 @@ Revision history for Perl extension ExtUtils::ParseXS. -3.04_02 - ... +3.04_03 - Sun Sep 4 18:49:00 CET 2011 + + - By #defining PERL_EUPXS_ALWAYS_EXPORT or + PERL_EUPXS_NEVER_EXPORT early in your XS code, you can + force ExtUtils::ParseXS to always or never export + XSUB symbols. This has no effect on boot_* symbols since + those must be exported. + +3.04_02 - Sat Sep 3 15:28:00 CET 2011 - Don't put null characters into the generated source file when -except is used; write the '\0' escape sequence diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm index fe5874a..1d9a85f 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm @@ -11,7 +11,7 @@ use Symbol; our $VERSION; BEGIN { - $VERSION = '3.04_01'; + $VERSION = '3.04_03'; } use ExtUtils::ParseXS::Constants $VERSION; use ExtUtils::ParseXS::CountLines $VERSION; @@ -1477,7 +1477,13 @@ sub EXPORT_XSUB_SYMBOLS_handler { print Q(<<"EOF"); ##undef XS_EUPXS -##define XS_EUPXS(name) $xs_impl(name) +##if defined(PERL_EUPXS_ALWAYS_EXPORT) +## define XS_EUPXS(name) XS_EXTERNAL(name) +##elif defined(PERL_EUPXS_NEVER_EXPORT) +## define XS_EUPXS(name) XS_INTERNAL(name) +##else +## define XS_EUPXS(name) $xs_impl(name) +##endif EOF } diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm index 003123d..4e97418 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm @@ -3,7 +3,7 @@ use strict; use warnings; use Symbol; -our $VERSION = '3.04_01'; +our $VERSION = '3.04_03'; =head1 NAME diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm index 48753f1..3b166b1 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm @@ -1,7 +1,7 @@ package ExtUtils::ParseXS::CountLines; use strict; -our $VERSION = '3.04_01'; +our $VERSION = '3.04_03'; our $SECTION_END_MARKER; diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm index 831bb7b..4080458 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm @@ -6,7 +6,7 @@ use File::Spec; use lib qw( lib ); use ExtUtils::ParseXS::Constants (); -our $VERSION = '3.04_01'; +our $VERSION = '3.04_03'; our (@ISA, @EXPORT_OK); @ISA = qw(Exporter); @@ -533,9 +533,13 @@ sub standard_XS_defs { * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to! */ -/* default to internal */ #undef XS_EUPXS -#define XS_EUPXS(name) XS_INTERNAL(name) +#if defined(PERL_EUPXS_ALWAYS_EXPORT) +# define XS_EUPXS(name) XS_EXTERNAL(name) +#else + /* default to internal */ +# define XS_EUPXS(name) XS_INTERNAL(name) +#endif EOF