Farid Zaripov wrote:
Attached is a patch to disable displaying general protection fault
message box in test on Windows (singlethreaded configurations).
Looks good, thanks!
Martin
PS If this is needed in more than one test we might want to
introduce a common header with a function that handles it
(conditionally for Windows).
Martin
Farid.
------------------------------------------------------------------------
Index: THREAD_SAFE_EXCEPTIONS.cpp
===================================================================
--- THREAD_SAFE_EXCEPTIONS.cpp (revision 452510)
+++ THREAD_SAFE_EXCEPTIONS.cpp (working copy)
@@ -29,6 +29,13 @@
int main ()
{
+#if defined (_WIN32)
+ // disable displaying the critical-error-handler
+ // and general-protection-fault message boxes
+ // windows.h included in thread.h
+ SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
+#endif // _WIN32
+
pthread_t tid [2];
const unsigned N = sizeof tid / sizeof *tid;