From commits-return-2931-apmail-stdcxx-commits-archive=stdcxx.apache.org@stdcxx.apache.org Thu May 15 12:15:08 2008 Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 12928 invoked from network); 15 May 2008 12:15:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2008 12:15:08 -0000 Received: (qmail 56826 invoked by uid 500); 15 May 2008 12:15:10 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 56800 invoked by uid 500); 15 May 2008 12:15:10 -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 56789 invoked by uid 99); 15 May 2008 12:15:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 05:15:10 -0700 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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 12:14:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DA7DC2388A01; Thu, 15 May 2008 05:14:47 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r656615 - in /stdcxx/trunk: etc/config/windows/projects.js etc/config/windows/run_locale_utils.wsf tests/src/driver.cpp util/charmap.cpp Date: Thu, 15 May 2008 12:14:47 -0000 To: commits@stdcxx.apache.org From: faridz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080515121447.DA7DC2388A01@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: faridz Date: Thu May 15 05:14:47 2008 New Revision: 656615 URL: http://svn.apache.org/viewvc?rev=656615&view=rev Log: 2008-05-15 Farid Zaripov Merged from branches/4.2.x. 2008-05-15 Farid Zaripov * etc/config/windows/run_locale_utils.wsf (check_locale_m): Skip empty lines. 2008-05-14 Martin Sebor * util/charmap.cpp (utf8_decode): Explicitly initialized a local variable to silence gcc warning: variable may be used uninitialized. 2008-05-14 Farid Zaripov * util/charmap.cpp (convert_sym_to_ucs): Fixed bug with skipping the first digit in symbolic name. 2008-05-13 Farid Zaripov * util/charmap.cpp (convert_to_ucs) [_MSC_VER]: Process return code of MultiByteToWideChar() and fall back to convert_sym_to_ucs() if the conversion table for the requested codepage is not installed. 2008-05-12 Farid Zaripov * tests/src/driver.cpp (_rw_opt_no_popups) [_WIN32]: New function for handling --no-popups option (disables Windows and MSVC CRT popup windows). (_rw_opt_debug_heap) [_MSC_VER && _DEBUG]: New function for handling --debug-heap option (enables the intensive heap memory checking). (_rw_setopts_windows)[_WIN32]: New function for installing handlers for --no-popups and --debug-heap options. (rw_vtest) [_WIN32]: Call _rw_setopts_windows(). * etc/config/windows/projects.js (CreateProjectDefs): Added --no-popups option when running tests using exec utility. Modified: stdcxx/trunk/etc/config/windows/projects.js stdcxx/trunk/etc/config/windows/run_locale_utils.wsf stdcxx/trunk/tests/src/driver.cpp stdcxx/trunk/util/charmap.cpp Modified: stdcxx/trunk/etc/config/windows/projects.js URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/windows/projects.js?rev=656615&r1=656614&r2=656615&view=diff ============================================================================== --- stdcxx/trunk/etc/config/windows/projects.js (original) +++ stdcxx/trunk/etc/config/windows/projects.js Thu May 15 05:14:47 2008 @@ -334,7 +334,7 @@ " /PRJDIR:\"" + runtestsDef.VCProjDir + "\"" + " /CONFIG:\"%SOLUTION%\"" + " /LOGFILE:\"runtests.log\"" + - " /RUNFLAGS:\"--compat -x \'--compat -O -\' -t " + EXEC_TIMEOUT + "\""; + " /RUNFLAGS:\"--compat -x \'--no-popups --compat -O -\' -t " + EXEC_TIMEOUT + "\""; runtestsDef.CustomBuildOut = "$(OutDir)\\runtests.log"; runtestsDef.CustomBuildDeps = "%FILES%"; //runtestsDef.PrjDeps.push(alltestsDef); Modified: stdcxx/trunk/etc/config/windows/run_locale_utils.wsf URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/windows/run_locale_utils.wsf?rev=656615&r1=656614&r2=656615&view=diff ============================================================================== --- stdcxx/trunk/etc/config/windows/run_locale_utils.wsf (original) +++ stdcxx/trunk/etc/config/windows/run_locale_utils.wsf Thu May 15 05:14:47 2008 @@ -243,6 +243,9 @@ var line = aout[i].replace("\r", "").replace("\n", ""); + if (0 == line.length) + continue; + if (0 > line.search(new RegExp(".cm"))) { DebugOutLine(" incorrect."); Modified: stdcxx/trunk/tests/src/driver.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/driver.cpp?rev=656615&r1=656614&r2=656615&view=diff ============================================================================== --- stdcxx/trunk/tests/src/driver.cpp (original) +++ stdcxx/trunk/tests/src/driver.cpp Thu May 15 05:14:47 2008 @@ -45,9 +45,13 @@ #include // for free #include // for strchr, strcpy +#ifdef _WIN32 +# include // for SetErrorMode() +#endif // _WIN32 + #ifdef _MSC_VER # include // for _CrtSetReportMode(), _CrtSetDbgFlag() -#endif +#endif // _MSC_VER #if !defined (_WIN32) && !defined (_WIN64) # include // for isatty() @@ -492,12 +496,6 @@ // set mode: enable the option opt_verbose = 1; -#ifdef _MSC_VER - _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF - | _CRTDBG_CHECK_ALWAYS_DF - | _CRTDBG_LEAK_CHECK_DF); -#endif - return 0; } @@ -547,12 +545,6 @@ // set mode: enable the option opt_compat = 1; -#ifdef _MSC_VER - _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_DEBUG); - _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG); - _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG); -#endif - return 0; } @@ -930,6 +922,128 @@ return 0; } + +#ifdef _WIN32 + +static int +_rw_opt_no_popups (int argc, char *argv[]) +{ + static int opt_no_popups; + + if (0 == argc) { + // query mode: return the value of the option + return opt_no_popups; + } + + if (1 == argc && argv && 0 == argv [0]) { + // help mode: set argv[0] to the text of the help message + + static const char helpstr[] = { + "Prevents the program from using message box popup window's for\n" + "error messages.\n" + }; + + argv [0] = _RWSTD_CONST_CAST (char*, helpstr); + + return 0; + } + + // set mode: enable the option + opt_no_popups = 1; + + SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); + +# ifdef _MSC_VER + _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile (_CRT_WARN, _CRTDBG_FILE_STDERR); + _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile (_CRT_ERROR, _CRTDBG_FILE_STDERR); + _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile (_CRT_ASSERT, _CRTDBG_FILE_STDERR); +# endif // _MSC_VER + + return 0; +} + +#endif // _WIN32 + + +#if defined (_MSC_VER) && defined (_DEBUG) + +static int +_rw_opt_debug_heap (int argc, char *argv[]) +{ + static int opt_debug_heap; + + if (0 == argc) { + // query mode: return the value of the option + return opt_debug_heap; + } + + if (1 == argc && argv && 0 == argv [0]) { + // help mode: set argv[0] to the text of the help message + + static const char helpstr[] = { + "Enables the heap consistency checking on every memory allocation\n" + "and deallocation request.\n" + }; + + argv [0] = _RWSTD_CONST_CAST (char*, helpstr); + + return 0; + } + + // set mode: enable the option + opt_debug_heap = 1; + + _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF + | _CRTDBG_CHECK_ALWAYS_DF + | _CRTDBG_LEAK_CHECK_DF); + + return 0; +} + +#endif // _MSC_VER && _DEBUG + + +#ifdef _WIN32 + +static int +_rw_setopts_windows () +{ + int nopts = + rw_setopts ("|-no-popups ", + _rw_opt_no_popups, + 0 /* detect missing handlers */); + + if (1 > nopts) { + rw_fprintf (rw_stderr, + "%s:%d: rw_setopts() failed\n", __FILE__, __LINE__); + abort (); + return 1; + } + +# if defined (_MSC_VER) && defined (_DEBUG) + + nopts = + rw_setopts ("|-debug-heap ", + _rw_opt_debug_heap, + 0 /* detect missing handlers */); + + if (1 > nopts) { + rw_fprintf (rw_stderr, + "%s:%d: rw_setopts() failed\n", __FILE__, __LINE__); + abort (); + return 1; + } + +# endif // _MSC_VER && _DEBUG + + return 0; +} + +#endif // _WIN32 + /************************************************************************/ _TEST_EXPORT int @@ -995,6 +1109,10 @@ _rw_setopts_lines (); +#ifdef _WIN32 + _rw_setopts_windows (); +#endif // _WIN32 + int status = rw_runopts (argc, argv); if (status) Modified: stdcxx/trunk/util/charmap.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/util/charmap.cpp?rev=656615&r1=656614&r2=656615&view=diff ============================================================================== --- stdcxx/trunk/util/charmap.cpp (original) +++ stdcxx/trunk/util/charmap.cpp Thu May 15 05:14:47 2008 @@ -179,7 +179,7 @@ const unsigned char* const ch_end = _RWSTD_REINTERPRET_CAST (const unsigned char*, to); - size_t num_bytes; + size_t num_bytes = 0; wchar_t ret = 0; @@ -649,7 +649,7 @@ sym.c_str ()); } - const unsigned long val = std::strtoul (&*++it, (char**)0, 16); + const unsigned long val = std::strtoul (&*it, (char**)0, 16); if (_RWSTD_WCHAR_MAX <= val) issue_diag (E_UCS, true, 0, @@ -690,18 +690,24 @@ if (0 != codepage_) { wchar_t ret[2] = {0}; - MultiByteToWideChar (codepage_, 0, encoding.c_str(), -1, ret, 2); - if (ret[1] != 0) + const int res = MultiByteToWideChar (codepage_, 0, + encoding.c_str(), -1, + ret, 2); + if (!res && ERROR_INVALID_PARAMETER == GetLastError ()) { + // the required codepage conversion table is not installed + wc = convert_sym_to_ucs (sym_name); + return true; + } + + if (!res || ret[1] != 0) return false; wc = ret[0]; return true; - } else { - wc = convert_sym_to_ucs (sym_name); - return true; } - return false; + wc = convert_sym_to_ucs (sym_name); + return true; #endif // _MSC_VER }