Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 May 2004 20:08:00 +1000
From:      Tim Robbins <tjr@freebsd.org>
To:        Jeremy Messenger <mezz7@cox.net>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Does 4.x supports wchar_t/wstring?
Message-ID:  <20040511100800.GA34687@cat.robbins.dropbear.id.au>
In-Reply-To: <opr7tvlels8ckrg5@smtp.central.cox.net>
References:  <opr7tvlels8ckrg5@smtp.central.cox.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 11, 2004 at 04:06:40AM -0500, Jeremy Messenger wrote:
> Hello,
> 
> Current, I am having the problem with the games/wesnoth build on 4.x only. 
> I tried to get it builds w/ GCC 3.3, but still no luck. It shows that 
> _GLIBCPP_USE_WCHAR_T is not defined, so I am wondering if there has any 
> workaround for it?
...
> The fail is location on language.hpp 61/62 line:
> =============================================
> std::string wstring_to_string(const std::wstring &);
> std::wstring string_to_wstring(const std::string &);
> =============================================

It looks like the definition of the std::wstring class is commented out on
FreeBSD 4 because <cwctype> is missing. You could try adding this wherever
necessary:
	#include <cwchar>
	typedef basic_string<wchar_t> std::wstring;

It will work for most simple things, but not stream I/O.

Another workaround is to uncomment the definition in g++/string, un-#if 0
the definition of string_char_traits <wchar_t> in g++/std/straits.h,
change the #include line preceding it to <cctype>, and change iswspace() to
isspace(). This is not as much of a hack as it sounds, since the 4.4BSD ctype
functions accept wide characters, but it's obviously not something a port
should be doing.


Tim



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