Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2002 18:02:17 -0400 (EDT)
From:      Thomas David Rivers <rivers@dignus.com>
To:        mb@imp.ch, rivers@dignus.com
Cc:        current@FreeBSD.ORG, obrien@FreeBSD.ORG
Subject:   Re: PATCH: wchar_t is already defined in libstd++
Message-ID:  <200206172202.g5HM2HW52939@lakes.dignus.com>
In-Reply-To: <20020617235725.F60170-100000@levais.imp.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206172202.g5HM2HW52939>