stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r662706 - /stdcxx/branches/4.2.x/tests/src/driver.cpp
Date Tue, 03 Jun 2008 08:52:02 GMT
Author: faridz
Date: Tue Jun  3 01:52:01 2008
New Revision: 662706

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

	* 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.2.x/tests/src/driver.cpp

Modified: stdcxx/branches/4.2.x/tests/src/driver.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/driver.cpp?rev=662706&r1=662705&r2=662706&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/src/driver.cpp (original)
+++ stdcxx/branches/4.2.x/tests/src/driver.cpp Tue Jun  3 01:52:01 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);



Mime
View raw message