This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
remove redundant PERL_EXPORT_C and PERL_XS_EXPORT_C macros
authorDaniel Dragan <bulk88@hotmail.com>
Mon, 11 May 2015 03:30:21 +0000 (23:30 -0400)
committerTony Cook <tony@develop-help.com>
Wed, 3 Jun 2015 01:48:36 +0000 (11:48 +1000)
commitfc6bde6fcee5810d400f6080fe2039469c4d2ad3
tree9d7601abffcc807c5d6c90f899e61b48dd8983f4
parent87d9837674dfb6ff391470e04bc610a6c11f58f2
remove redundant PERL_EXPORT_C and PERL_XS_EXPORT_C macros

These 2 macros were created for the Symbian port in commit
"Symbian port of Perl" to replace a direct "extern" token. I guess the
author was unaware of PERL_CALLCONV.

PERL_CALLCONV is the official macro to use. PERL_XS_EXPORT_C and
PERL_EXPORT_C have no usage on cpan grep except for modules with direct
copies of core headers. A defect of using PERL_EXPORT_C and
PERL_XS_EXPORT_C instead of PERL_CALLCONV is that win32/win32.h has no
knowledge of the 2 macros and doesn't set them, and os/os2ish.h doesn't
either. On Win32, since the unix defaults are used instead of Win32
specific "__declspec(dllimport)" token, XS modules use indirect function
stubs in each XS module placed by the CC to call into perl5**.dll instead
of directly calls the core C functions. I observed this in in XS-Typemap's
DLL. To simplify the API, and to decrease the amount of macros needing to
implemented to support each platform, just remove the 2 macros.

Since perl.h's fallback defaults for PERL_CALLCONV are very late in perl.h,
they need to be moved up before function declarations start in perlio.h
(perlio.h is included from iperlsys.h).

win32iop.h contains the "PerlIO" and SV" tokens, so perlio.h must be
included before win32iop.h is. Including perlio.h so early in win32.h,
causes PERL_CALLCONV not be defined since Win32 platform uses the
fallback in perl.h, since win32.h doesn't always define PERL_CALLCONV and
sometimes relies on the fallback. Since win32iop.h contains alot of
declarations, it belongs with other declarations such as those in proto.h
so move it from win32.h to perl.h.

the "free" token in struct regexp_engine conflicts with win32iop's
"#define free win32_free" so rename that member.
handy.h
perl.h
perlio.h
perliol.h
regexp.h
symbian/symbianish.h
win32/win32.h