Restore Win64 compilation with the Windows Platform SDK
authorJan Dubois <jand@activestate.com>
Mon, 9 Apr 2007 17:27:17 +0000 (10:27 -0700)
committerSteve Peters <steve@fisharerojo.org>
Tue, 10 Apr 2007 02:30:38 +0000 (02:30 +0000)
Message-ID: <4kll13df3tndn8alp54gi9ur9jmq063aij@4ax.com>

p4raw-id: //depot/perl@30878

lib/ExtUtils/MM_Win32.pm
win32/win32.c

index 95264a0..75d01ca 100644 (file)
@@ -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});
index aacc656..4337256 100644 (file)
@@ -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 <crtdbg.h>
 #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);