You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2008/06/03 10:55:00 UTC

svn commit: r662707 - /stdcxx/branches/4.3.x/tests/src/driver.cpp

Author: faridz
Date: Tue Jun  3 01:55:00 2008
New Revision: 662707

URL: http://svn.apache.org/viewvc?rev=662707&view=rev
Log:
2008-06-03  Farid Zaripov  <fa...@epam.com>

	Merged r662706 from 4.2.x branch.
	* tests/src/driver.cpp (_rw_invalid_parameter) [_MSC_VER >= 1400]: New
	function - invalid parameter handler.
	(_rw_opt_no_popups) [_MSC_VER >= 1400]: Set _rw_invalid_parameter() as
	invalid parameter handler to disable invalid parameter CRT popups.

Modified:
    stdcxx/branches/4.3.x/tests/src/driver.cpp

Modified: stdcxx/branches/4.3.x/tests/src/driver.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/driver.cpp?rev=662707&r1=662706&r2=662707&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/src/driver.cpp (original)
+++ stdcxx/branches/4.3.x/tests/src/driver.cpp Tue Jun  3 01:55:00 2008
@@ -42,7 +42,7 @@
 #include <setjmp.h>    // for longjmp, setjmp, ...
 #include <stdarg.h>    // for va_list
 #include <stdio.h>     // for fileno
-#include <stdlib.h>    // for free
+#include <stdlib.h>    // for free, _set_invalid_parameter_handler()
 #include <string.h>    // for strchr, strcpy
 
 #ifdef _WIN32
@@ -925,6 +925,20 @@
 
 #ifdef _WIN32
 
+#  if defined (_MSC_VER) && _MSC_VER >= 1400
+
+static void
+_rw_invalid_parameter (const wchar_t* /*expression*/,
+                       const wchar_t* /*function*/,
+                       const wchar_t* /*file*/,
+                       unsigned int   /*line*/,
+                       uintptr_t      /*pReserved*/)
+{
+    // empty handler - ignore invalid parameter validation
+}
+
+#  endif   // MSVC 8.0 and later
+
 static int
 _rw_opt_no_popups (int argc, char *argv[])
 {
@@ -954,6 +968,10 @@
     SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
 
 #  ifdef _MSC_VER
+#    if _MSC_VER >= 1400
+    _set_invalid_parameter_handler (_rw_invalid_parameter);
+#    endif   // MSVC 8.0 and later
+
     _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
     _CrtSetReportFile (_CRT_WARN, _CRTDBG_FILE_STDERR);
     _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);