From owner-freebsd-current Mon Jun 17 15: 8:52 2002 Delivered-To: freebsd-current@freebsd.org Received: from dignus.com (sdsl-64-32-254-102.dsl.iad.megapath.net [64.32.254.102]) by hub.freebsd.org (Postfix) with ESMTP id 10CD137B404; Mon, 17 Jun 2002 15:08:10 -0700 (PDT) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.11.6/8.11.3) with ESMTP id g5HM1ph83467; Mon, 17 Jun 2002 18:01:51 -0400 (EDT) (envelope-from rivers@dignus.com) Received: (from rivers@localhost) by lakes.dignus.com (8.11.6/8.11.3) id g5HM2HW52939; Mon, 17 Jun 2002 18:02:17 -0400 (EDT) (envelope-from rivers) Date: Mon, 17 Jun 2002 18:02:17 -0400 (EDT) From: Thomas David Rivers Message-Id: <200206172202.g5HM2HW52939@lakes.dignus.com> To: mb@imp.ch, rivers@dignus.com Subject: Re: PATCH: wchar_t is already defined in libstd++ Cc: current@FreeBSD.ORG, obrien@FreeBSD.ORG In-Reply-To: <20020617235725.F60170-100000@levais.imp.ch> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Hi, > > > Uh... > > > > In standard C++, wchar_t is a keyword. So, there should be > > no definition of wchar_t at all. I think this is the problem. > > (You can't typedef a predefined keyword.) > > > > (Now - the compiler should certainly have the very same > > idea of what a wchar_t is.. the same idea as the C typedef, > > but that's a gcc configuration problem.) > > > > - Dave Rivers - > > > > So my patches would be correct ? > > Martin > > If you are using a standard C++ compiler, then the include files should _not_ provide a typedef for wchar_t. The correct approach (and, I have to admit to not glancing at your patch) would be: #ifndef __cplusplus typedef _BSD_WCHAR_T_ wchar_t #endif I'm not sure how compliant gcc is in this area, but it's likely that newer versions are compliant, and this should be the approach. Although - you could make it conditional on various versions of gcc, etc... - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message