From commits-return-2495-apmail-stdcxx-commits-archive=stdcxx.apache.org@stdcxx.apache.org Fri Mar 07 16:17:20 2008 Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 75302 invoked from network); 7 Mar 2008 16:17:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Mar 2008 16:17:20 -0000 Received: (qmail 94166 invoked by uid 500); 7 Mar 2008 16:17:16 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 94142 invoked by uid 500); 7 Mar 2008 16:17:16 -0000 Mailing-List: contact commits-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list commits@stdcxx.apache.org Received: (qmail 94133 invoked by uid 99); 7 Mar 2008 16:17:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2008 08:17:16 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2008 16:16:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0A3181A983A; Fri, 7 Mar 2008 08:16:59 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r634728 - in /stdcxx/trunk/etc/config/src: DYNAMIC_CAST.cpp GLOBAL_BAD_ALLOC.cpp NO_DBL_TRAPS.cpp STD_BAD_ALLOC.cpp THREAD_SAFE_EXCEPTIONS.cpp nodbg.h Date: Fri, 07 Mar 2008 16:16:57 -0000 To: commits@stdcxx.apache.org From: faridz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080307161659.0A3181A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: faridz Date: Fri Mar 7 08:16:56 2008 New Revision: 634728 URL: http://svn.apache.org/viewvc?rev=634728&view=rev Log: 2008-03-07 Farid Zaripov * etc/config/src/nodbg.h: New header file with definition of the nodbg() to prevent GUI popups on Windows. * etc/config/src/DYNAMIC_CAST.cpp: Removed invoking of the _CrtSetReportMode(), using nodbg() instead. * etc/config/src/GLOBAL_BAD_ALLOC.cpp: Ditto. * etc/config/src/STD_BAD_ALLOC.cpp: Ditto. * etc/config/src/THREAD_SAFE_EXCEPTIONS.cpp: Ditto. * etc/config/src/NO_DBL_TRAPS.cpp: Invoke nodbg() before test to prevent the Dr.Watson popups (was detected on Borland Turbo C++). Added: stdcxx/trunk/etc/config/src/nodbg.h (with props) Modified: stdcxx/trunk/etc/config/src/DYNAMIC_CAST.cpp stdcxx/trunk/etc/config/src/GLOBAL_BAD_ALLOC.cpp stdcxx/trunk/etc/config/src/NO_DBL_TRAPS.cpp stdcxx/trunk/etc/config/src/STD_BAD_ALLOC.cpp stdcxx/trunk/etc/config/src/THREAD_SAFE_EXCEPTIONS.cpp Modified: stdcxx/trunk/etc/config/src/DYNAMIC_CAST.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/DYNAMIC_CAST.cpp?rev=634728&r1=634727&r2=634728&view=diff ============================================================================== --- stdcxx/trunk/etc/config/src/DYNAMIC_CAST.cpp (original) +++ stdcxx/trunk/etc/config/src/DYNAMIC_CAST.cpp Fri Mar 7 08:16:56 2008 @@ -23,10 +23,7 @@ **************************************************************************/ #include "config.h" - -#if (defined (_WIN32) || defined (_WIN64)) && !defined (__CYGWIN__) -# include -#endif // _WIN{32,64} +#include "nodbg.h" #ifndef _RWSTD_NO_HONOR_STD @@ -47,14 +44,7 @@ int main () { -#if (defined (_WIN32) || defined (_WIN64)) && !defined (__CYGWIN__) - - // prevent the Microsoft C library from popping up GUI windows - _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_DEBUG); - _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG); - _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG); - -#endif // _WIN{32,64} + nodbg (); B b; Modified: stdcxx/trunk/etc/config/src/GLOBAL_BAD_ALLOC.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/GLOBAL_BAD_ALLOC.cpp?rev=634728&r1=634727&r2=634728&view=diff ============================================================================== --- stdcxx/trunk/etc/config/src/GLOBAL_BAD_ALLOC.cpp (original) +++ stdcxx/trunk/etc/config/src/GLOBAL_BAD_ALLOC.cpp Fri Mar 7 08:16:56 2008 @@ -23,6 +23,7 @@ **************************************************************************/ #include "config.h" +#include "nodbg.h" #if !defined (_RWSTD_NO_NEW_THROWS) && !defined (_RWSTD_NO_NEW_OFLOW_SAFE) # include // for size_t @@ -45,29 +46,11 @@ struct bad_alloc { }; -#if defined (_MSC_VER) - -#include // for _CrtSetReportMode() - -void disable_msc_gui () -{ - _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE); - _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE); -} - -#else // if !defined (_MSC_VER) - -void disable_msc_gui () { /* no-op */ } - -#endif // _MSC_VER - - int main () { // prevent MSVC's libc from popping up a dialog box // with an out-of-memory message - disable_msc_gui (); + nodbg (); try { Modified: stdcxx/trunk/etc/config/src/NO_DBL_TRAPS.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/NO_DBL_TRAPS.cpp?rev=634728&r1=634727&r2=634728&view=diff ============================================================================== --- stdcxx/trunk/etc/config/src/NO_DBL_TRAPS.cpp (original) +++ stdcxx/trunk/etc/config/src/NO_DBL_TRAPS.cpp Fri Mar 7 08:16:56 2008 @@ -37,11 +37,15 @@ * disables traps as required by C). */ +#include "nodbg.h" + double dbl_get_zero (); double dbl_get_one (); int main (int argc, char*[]) { + nodbg (); + double dbl_inf; double dbl_nan; Modified: stdcxx/trunk/etc/config/src/STD_BAD_ALLOC.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/STD_BAD_ALLOC.cpp?rev=634728&r1=634727&r2=634728&view=diff ============================================================================== --- stdcxx/trunk/etc/config/src/STD_BAD_ALLOC.cpp (original) +++ stdcxx/trunk/etc/config/src/STD_BAD_ALLOC.cpp Fri Mar 7 08:16:56 2008 @@ -23,6 +23,7 @@ **************************************************************************/ #include "config.h" +#include "nodbg.h" #if !defined (_RWSTD_NO_NEW_THROWS) && !defined (_RWSTD_NO_NEW_OFLOW_SAFE) # include // for size_t @@ -52,29 +53,11 @@ enum bad_alloc { }; -#if defined (_MSC_VER) - -#include // for _CrtSetReportMode() - -void disable_msc_gui () -{ - _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE); - _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE); -} - -#else // if !defined (_MSC_VER) - -void disable_msc_gui () { /* no-op */ } - -#endif // _MSC_VER - - int main () { // prevent MSVC's libc from popping up a dialog box // with an out-of-memory message - disable_msc_gui (); + nodbg (); try { Modified: stdcxx/trunk/etc/config/src/THREAD_SAFE_EXCEPTIONS.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/THREAD_SAFE_EXCEPTIONS.cpp?rev=634728&r1=634727&r2=634728&view=diff ============================================================================== --- stdcxx/trunk/etc/config/src/THREAD_SAFE_EXCEPTIONS.cpp (original) +++ stdcxx/trunk/etc/config/src/THREAD_SAFE_EXCEPTIONS.cpp Fri Mar 7 08:16:56 2008 @@ -23,6 +23,7 @@ **************************************************************************/ #include "thread.h" +#include "nodbg.h" extern "C" void* thread_proc (void *arg) @@ -51,12 +52,7 @@ 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 + nodbg (); pthread_t tid [2]; Added: stdcxx/trunk/etc/config/src/nodbg.h URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/nodbg.h?rev=634728&view=auto ============================================================================== --- stdcxx/trunk/etc/config/src/nodbg.h (added) +++ stdcxx/trunk/etc/config/src/nodbg.h Fri Mar 7 08:16:56 2008 @@ -0,0 +1,54 @@ +// definition of the nodbg() function + +/*************************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + * Copyright 1999-2008 Rogue Wave Software, Inc. + * + **************************************************************************/ + +#ifdef _WIN32 + +# include + +# ifdef _MSC_VER +# include // for _CrtSetReportMode() +# endif + +void nodbg () +{ +# ifdef _MSC_VER + // prevent the Microsoft C library from popping up GUI windows + // on various failures and direct error messages to the console + // instead + _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_DEBUG); + _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG); + _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG); +# endif + + // disable displaying the critical-error-handler + // and general-protection-fault message boxes + // windows.h included in thread.h + SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); +} + +#else + +void nodbg () { } + +#endif // _WIN32 Propchange: stdcxx/trunk/etc/config/src/nodbg.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: stdcxx/trunk/etc/config/src/nodbg.h ------------------------------------------------------------------------------ svn:keywords = Id