I have just pushed a change to the core perl repository that adds the
XS_INTERNAL and XS_EXTERNAL macros that correspond to "static" and
exported XSUB symbols respectively. People seem to be fine with this
change, but there may, of course, still be a public outcry.
Right now, XS is still defined to be XS_EXTERNAL, but if in the C
section of your XS file, you add something like the following (last
three lines matter most, the rest is just a perl version guad), you can
choose to have static XSUBs.
#define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#define PERL_DECIMAL_VERSION \
PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#define PERL_VERSION_GE(r,v,s) \
(PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#if PERL_VERSION_GE(5, 15, 2)
#define XS(name) XS_INTERNAL(name)
#endif
(WARNING: blead perl is still versioned as 5.15.1!)
There may or may not be an ExtUtils::ParseXS feature that backports this
to older versions of perl. The XS(name) definition in XSUB.h hasn't
changed significantly since 5.10.0, so having an XS option akin to
PROTOTYPES that works as far back as that is almost trivial. (Patches
welcome).
I'd like to hear whether using the above version-guarded redefinition
makes a difference in Gtk2/etc load time!
Best regards,
Steffen