diff options
author | Steve Hay <SteveHay@planit.com> | 2006-11-06 16:26:48 +0000 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2006-11-06 16:26:48 +0000 |
commit | 0448a0bdbfbd5e00696d6b3361b97fb1190434c1 (patch) | |
tree | aee26d3aecc84963e69f9af0e0096db9101578d1 | |
parent | f8e2af1d968a8698b0c7b9d7a7879c75d8529d80 (diff) | |
download | perl-0448a0bdbfbd5e00696d6b3361b97fb1190434c1.tar.gz |
Get Visual C++ 2005 (aka Visual C++ 8.x) support off the ground
This is not a complete fix yet by any means (there are lots of compiler
warnings and lots of test failures), but it's a step in the right
direction.
See the thread starting here:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-10/msg00893.html
and continuing here:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-11/msg00102.html
for further information
p4raw-id: //depot/perl@29218
-rw-r--r-- | win32/Makefile | 3 | ||||
-rw-r--r-- | win32/makefile.mk | 4 | ||||
-rw-r--r-- | win32/win32.c | 25 | ||||
-rw-r--r-- | win32/win32.h | 9 |
4 files changed, 41 insertions, 0 deletions
diff --git a/win32/Makefile b/win32/Makefile index 3fbcbec28b..2044a69b69 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -434,6 +434,9 @@ DEFINES = $(DEFINES) -DWIN64 -DCONSERVATIVE OPTIMIZE = $(OPTIMIZE) -Wp64 -fp:precise !ENDIF +# Use the MSVCRT read() fix if the PerlCRT was not chosen. This may be not +# necessary with recent MSVCRT's, but we use the fix anyway in case this build +# is going to be run on a system with an old MSVCRT. !IF "$(USE_PERLCRT)" != "define" BUILDOPT = $(BUILDOPT) -DPERL_MSVCRT_READFIX !ENDIF diff --git a/win32/makefile.mk b/win32/makefile.mk index 92263ba333..7c9fca7a57 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -485,6 +485,7 @@ EXEOUT_FLAG = -o LIBOUT_FLAG = # NOTE: we assume that GCC uses MSVCRT.DLL +# See comments about PERL_MSVCRT_rEADFIX in the "cl" compiler section below. BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX .ELSE @@ -544,6 +545,9 @@ DEFINES += -DWIN64 -DCONSERVATIVE OPTIMIZE += -Wp64 -fp:precise .ENDIF +# Use the MSVCRT read() fix if the PerlCRT was not chosen. This may be not +# necessary with recent MSVCRT's, but we use the fix anyway in case this build +# is going to be run on a system with an old MSVCRT. .IF "$(USE_PERLCRT)" != "define" BUILDOPT += -DPERL_MSVCRT_READFIX .ENDIF diff --git a/win32/win32.c b/win32/win32.c index b800ed6685..31a54a9706 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -133,6 +133,21 @@ _matherr(struct _exception *a) } #endif +#if _MSC_VER >= 1400 +void my_invalid_parameter_handler(const wchar_t* expression, + const wchar_t* function, + const wchar_t* file, + unsigned int line, + uintptr_t pReserved) +{ +# ifdef _DEBUG + wprintf(L"Invalid parameter detected in function %s." + L" File: %s Line: %d\n", function, file, line); + wprintf(L"Expression: %s\n", expression); +# endif +} +#endif + int IsWin95(void) { @@ -4859,9 +4874,19 @@ win32_ctrlhandler(DWORD dwCtrlType) } +#if _MSC_VER >= 1400 +# include <crtdbg.h> +#endif + void Perl_win32_init(int *argcp, char ***argvp) { +#if _MSC_VER >= 1400 + _invalid_parameter_handler oldHandler, newHandler; + newHandler = my_invalid_parameter_handler; + oldHandler = _set_invalid_parameter_handler(newHandler); + _CrtSetReportMode(_CRT_ASSERT, 0); +#endif /* Disable floating point errors, Perl will trap the ones we * care about. VC++ RTL defaults to switching these off * already, but the Borland RTL doesn't. Since we don't diff --git a/win32/win32.h b/win32/win32.h index 2a87528f1d..f761211d5f 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -510,6 +510,15 @@ typedef struct { char pipech; /* one char buffer for handles opened on pipes */ int lockinitflag; CRITICAL_SECTION lock; +#if _MSC_VER >= 1400 +# ifndef _SAFECRT_IMPL + /* Not used in the safecrt downlevel. We do not define them, so we cannot + * use them accidentally */ + char textmode : 7;/* __IOINFO_TM_ANSI or __IOINFO_TM_UTF8 or __IOINFO_TM_UTF16LE */ + char unicode : 1; /* Was the file opened as unicode? */ + char pipech2[2]; /* 2 more peak ahead chars for UNICODE mode */ +# endif +#endif } ioinfo; |