diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2012-10-11 01:47:19 -0400 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2012-10-11 08:22:11 +0100 |
commit | a19baa613c9769701790afd2f9ebfc422a1e97e7 (patch) | |
tree | 1a1c651ec0523caf056785ed46f410d229e3eb75 /EXTERN.h | |
parent | 98c015b7a9b5140b2750b25518eb68b5024d7652 (diff) | |
download | perl-a19baa613c9769701790afd2f9ebfc422a1e97e7.tar.gz |
stop Win32 VC miniperl from exporting functions
miniperl.exe does not load XS modules. It has no reason to export anything.
About 130 things are exported by VC Win32 miniperl. 90% of them are
the win32_* functions. All but a couple Perl_* exports are gone in the
exporting miniperl. See perl #115216 for the full list of accidentally
exported items. Also stop trying to find Win32CORE's boot function in
Perl_init_os_extras through the export table. It is not exported and not
in the miniperl image and GetProcAddress will never return not NULL. By
removing this GetProcAddress call, miniperl stops importing GetProcAddress
from kernel32 and a tiny bit startup time by miniperl during the full
perl build process. By removing the exports the compiler is free to use
more random (not cdecl) calling conventions and/or optimizing away code
than before. Also by removing the export entries, and the GetProcAddress
import, RO strings are removed from the miniperl image. This commit only
affects the VC miniperl. The Mingw miniperl remains unmodified except
for not trying to load Win32CORE through the export table and some of the
.c files being compiled with PERL_IS_MINIPERL when previously they were
not.
Diffstat (limited to 'EXTERN.h')
-rw-r--r-- | EXTERN.h | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -29,16 +29,24 @@ # define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly #else # if (defined(WIN32) || defined(__SYMBIAN32__)) && !defined(PERL_STATIC_SYMS) -# if defined(PERLDLL) || defined(__SYMBIAN32__) -# define EXT extern __declspec(dllexport) +/* miniperl should not export anything */ +# if defined(PERL_IS_MINIPERL) && !defined(UNDER_CE) && defined(_MSC_VER) +# define EXT extern # define dEXT -# define EXTCONST extern __declspec(dllexport) const +# define EXTCONST extern const # define dEXTCONST const # else -# define EXT extern __declspec(dllimport) -# define dEXT -# define EXTCONST extern __declspec(dllimport) const -# define dEXTCONST const +# if defined(PERLDLL) || defined(__SYMBIAN32__) +# define EXT extern __declspec(dllexport) +# define dEXT +# define EXTCONST extern __declspec(dllexport) const +# define dEXTCONST const +# else +# define EXT extern __declspec(dllimport) +# define dEXT +# define EXTCONST extern __declspec(dllimport) const +# define dEXTCONST const +# endif # endif # else # if defined(__CYGWIN__) && defined(USEIMPORTLIB) |