From owner-freebsd-stable@FreeBSD.ORG Wed May 12 01:59:14 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 DAC3E16A4CE; Wed, 12 May 2004 01:59:14 -0700 (PDT) Received: from lakermmtao03.cox.net (lakermmtao03.cox.net [68.230.240.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BE3F43D1D; Wed, 12 May 2004 01:59:14 -0700 (PDT) (envelope-from mezz7@cox.net) Received: from mezz.mezzweb.com ([68.103.32.140]) by lakermmtao03.cox.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20040512085913.DKEN22312.lakermmtao03.cox.net@mezz.mezzweb.com>; Wed, 12 May 2004 04:59:13 -0400 Date: Wed, 12 May 2004 03:59:50 -0500 To: Tim Robbins References: <20040511100800.GA34687@cat.robbins.dropbear.id.au> From: Jeremy Messenger Content-Type: text/plain; format=flowed; charset=iso-8859-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <20040511100800.GA34687@cat.robbins.dropbear.id.au> User-Agent: Opera7.23/Linux M2 build 518 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: Wed, 12 May 2004 08:59:15 -0000 On Tue, 11 May 2004 20:08:00 +1000, Tim Robbins wrote: > 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. Thanks! Above didn't work, but I tweaked a little by using namespace and it compiles fine. Also, the game ran fine. I added looks like this: ============================================= #if (__FreeBSD_version < 500029) #include namespace std { typedef basic_string wstring; } #endif ============================================= Cheers, Mezz > 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 -- mezz7@cox.net - mezz@FreeBSD.org bsdforums.org 's moderator, mezz.