Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 72480 invoked from network); 19 Oct 2007 14:29:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Oct 2007 14:29:21 -0000 Received: (qmail 6657 invoked by uid 500); 19 Oct 2007 14:28:49 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 6649 invoked by uid 500); 19 Oct 2007 14:28:49 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 6631 invoked by uid 99); 19 Oct 2007 14:28:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2007 07:28:49 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Farid_Zaripov@epam.com designates 217.21.63.3 as permitted sender) Received: from [217.21.63.3] (HELO EPMSA009.epam.com) (217.21.63.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2007 14:28:37 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: __rw_once warnings in non-reentrant Windows builds? Date: Fri, 19 Oct 2007 17:28:14 +0300 Message-ID: <7BDB2168BEAEF14C98F1901FD2DE64380117EC2E@epmsa009.minsk.epam.com> In-Reply-To: <4714D43B.3070806@roguewave.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: __rw_once warnings in non-reentrant Windows builds? Thread-Index: AcgQBqxeIwzbhZ0zQq2sL1VFsQ/D8ACTOM8g References: <4714CBA1.50402@roguewave.com> <4714CE7C.7090908@roguewave.com> <7BDB2168BEAEF14C98F1901FD2DE64380117E4DC@epmsa009.minsk.epam.com> <4714D43B.3070806@roguewave.com> From: "Farid Zaripov" To: X-Virus-Checked: Checked by ClamAV on apache.org > -----Original Message----- > From: Martin Sebor [mailto:sebor@roguewave.com]=20 > Sent: Tuesday, October 16, 2007 6:10 PM > To: stdcxx-dev@incubator.apache.org > Subject: Re: __rw_once warnings in non-reentrant Windows builds? >=20 > > We could safely #undefine _RWSTD_REENTRANT macro for out=20 > > single-threaded builds. >=20 > I think we *should* do that. The Visual Studio CRT can always=20 > be thread safe but if we give our users the choice between=20 > reentrant builds of stdcxx and non-reentrant ones and they=20 > pick the latter we need to honor it. The patch is below. > For 4.2.0, I think we just need to go with what we have now=20 > but we should make this work right in 4.2.1. ChangeLog: * etc/config/windows/configure.wsf (configure): #define _RWSTD_NO_REENTRANT macro in config.h file for single-threaded builds. * include/rw/_config-msvcrt.h: #define _RWSTD_REENTRANT macro only if #defined _MT and not #defined _RWSTD_NO_REENTRANT, for single-threaded builds with compilers, that doesn't have the single-threaded CRT (i.e MSVC 8, MSVC 9). ---------------------------------- Index: etc/config/windows/configure.wsf =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- etc/config/windows/configure.wsf (revision 586373) +++ etc/config/windows/configure.wsf (working copy) @@ -265,6 +265,11 @@ // headers and functions check checkHeaders(); =20 + if (confInfo.mt) + appendLineToOutFile("// #define _RWSTD_NO_REENTRANT"); + else + appendLineToOutFile("#define _RWSTD_NO_REENTRANT"); + // compile .lib.cpp s if (0 =3D=3D compileLibs(confInfo.dll)) cleanQuit(1, exitmsg); Index: include/rw/_config-msvcrt.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- include/rw/_config-msvcrt.h (revision 586373) +++ include/rw/_config-msvcrt.h (working copy) @@ -185,7 +185,7 @@ # define _WIN32 #endif =20 -#ifdef _MT +#if defined (_MT) && !defined (_RWSTD_NO_REENTRANT) # ifndef _RWSTD_REENTRANT # define _RWSTD_REENTRANT 1 # endif // _RWSTD_REENTRANT @@ -196,11 +196,14 @@ # define _RWSTD_THREAD __declspec (thread) # endif // _RWSTD_THREAD # endif // _RWSTD_NO_TLS -#else // if !defined (_MT) +#else // if !defined (_MT) || defined (_RWSTD_NO_REENTRANT) +# ifdef _RWSTD_REENTRANT +# undef _RWSTD_REENTRANT +# endif // _RWSTD_REENTRANT # ifndef _RWSTD_THREAD # define _RWSTD_THREAD /* empty */ # endif // _RWSTD_THREAD -#endif //_MT +#endif // _MT && !_RWSTD_NO_REENTRANT =20 #if defined (_CPPRTTI) // override in case library was configured with -GR- ---------------------------------- Farid.