From: Jan Dubois Date: Mon, 9 Apr 2007 17:27:17 +0000 (-0700) Subject: Restore Win64 compilation with the Windows Platform SDK X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58d049f00f60aef7f74b8009451ce6d3c97fbf6b;p=p5sagit%2Fp5-mst-13.2.git Restore Win64 compilation with the Windows Platform SDK Message-ID: <4kll13df3tndn8alp54gi9ur9jmq063aij@4ax.com> p4raw-id: //depot/perl@30878 --- diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index 95264a0..75d01ca 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -29,7 +29,7 @@ use vars qw(@ISA $VERSION); require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); -$VERSION = '1.14'; +$VERSION = '1.14_01'; $ENV{EMXSHELL} = 'sh'; # to run `commands` @@ -341,7 +341,8 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP). push(@m, q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) } .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)}); - if ($Config{cc} eq 'cl' and $Config{ccversion} =~ /^(\d+)/ and $1 >= 14) { # VC 2005 (aka VC 8) or higher + # VS2005 (aka VC 8) or higher, but not for 64-bit compiler from Platform SDK + if ($Config{ivsize} == 4 && $Config{cc} eq 'cl' and $Config{ccversion} =~ /^(\d+)/ and $1 >= 14) { push(@m, q{ mt -nologo -manifest $@.manifest -outputresource:$@;2 && del $@.manifest}); diff --git a/win32/win32.c b/win32/win32.c index aacc656..4337256 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -164,7 +164,22 @@ _matherr(struct _exception *a) } #endif -#if _MSC_VER >= 1400 +/* VS2005 (MSC version 14) provides a mechanism to set an invalid + * parameter handler. This functionality is not available in the + * 64-bit compiler from the Platform SDK, which unfortunately also + * believes itself to be MSC version 14. + * + * There is no #define related to _set_invalid_parameter_handler(), + * but we can check for one of the constants defined for + * _set_abort_behavior(), which was introduced into stdlib.h at + * the same time. + */ + +#if _MSC_VER >= 1400 && defined(_WRITE_ABORT_MSG) +# define SET_INVALID_PARAMETER_HANDLER +#endif + +#ifdef SET_INVALID_PARAMETER_HANDLER void my_invalid_parameter_handler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, @@ -4648,7 +4663,7 @@ win32_ctrlhandler(DWORD dwCtrlType) } -#if _MSC_VER >= 1400 +#ifdef SET_INVALID_PARAMETER_HANDLER # include #endif @@ -4755,7 +4770,7 @@ Perl_win32_init(int *argcp, char ***argvp) { HMODULE module; -#if _MSC_VER >= 1400 +#ifdef SET_INVALID_PARAMETER_HANDLER _invalid_parameter_handler oldHandler, newHandler; newHandler = my_invalid_parameter_handler; oldHandler = _set_invalid_parameter_handler(newHandler);