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
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
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
}
#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)
{
}
+#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
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;