From owner-freebsd-stable@FreeBSD.ORG Tue May 11 03:08:54 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CD4516A4CE for ; Tue, 11 May 2004 03:08:54 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1FF843D3F for ; Tue, 11 May 2004 03:08:53 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.112.219) by smtp01.syd.iprimus.net.au (7.0.024) id 409956B4001D9414; Tue, 11 May 2004 20:08:50 +1000 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 906A541E5; Tue, 11 May 2004 20:08:00 +1000 (EST) Date: Tue, 11 May 2004 20:08:00 +1000 From: Tim Robbins To: Jeremy Messenger Message-ID: <20040511100800.GA34687@cat.robbins.dropbear.id.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: freebsd-stable@freebsd.org Subject: Re: Does 4.x supports wchar_t/wstring? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2004 10:08:54 -0000 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 is missing. You could try adding this wherever necessary: #include typedef basic_string 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 in g++/std/straits.h, change the #include line preceding it to , 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