In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/ad6ab6c50584b455ffb6a48d18fb6409bea8a3c1?hp=5f286eeea1a6d97101ebc9f6d579ca42c99e6711>
- Log ----------------------------------------------------------------- commit ad6ab6c50584b455ffb6a48d18fb6409bea8a3c1 Author: Jan Dubois <[email protected]> Date: Fri Oct 15 14:48:38 2010 -0700 Use __declspec(dllimport) for XS code on Windows By default C compilers will generate direct call instructions that the linker will have to route trhough a call thunk if the call site is not available at link time. By annotating all imported symbols the compiler is able to generate a indirect call instruction directly. This should improve performance minimally, but will also make sure the Perl API functions have the same addresses inside the core and inside XS modules. The ext/XS-APItest/t/call_checker.t tests rely on being able to compare function addresses. ----------------------------------------------------------------------- Summary of changes: win32/win32.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/win32/win32.h b/win32/win32.h index 762ab54..a7e3e12 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -55,6 +55,14 @@ #define DllExport __declspec(dllimport) #endif +#ifndef PERL_CORE +# ifdef __cplusplus +# define PERL_CALLCONV extern "C" __declspec(dllimport) +# else +# define PERL_CALLCONV __declspec(dllimport) +# endif +#endif + #define WIN32_LEAN_AND_MEAN #include <windows.h> -- Perl5 Master Repository
