From owner-freebsd-standards Wed Feb 19 16:29: 9 2003 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41EE237B401; Wed, 19 Feb 2003 16:29:08 -0800 (PST) Received: from dilbert.robbins.dropbear.id.au (184.b.005.mel.iprimus.net.au [210.50.41.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id 522C343F85; Wed, 19 Feb 2003 16:29:05 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (fwgcy7ndw6krpjjt@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id h1K0SuFa037778; Thu, 20 Feb 2003 11:28:57 +1100 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id h1K0Sl9a037777; Thu, 20 Feb 2003 11:28:47 +1100 (EST) (envelope-from tim) Date: Thu, 20 Feb 2003 11:28:47 +1100 From: Tim Robbins To: Craig Rodrigues Cc: freebsd-standards@FreeBSD.org, kan@FreeBSD.org Subject: Re: WCHAR_MIN and WCHAR_MAX not defined in Message-ID: <20030220112847.A36977@dilbert.robbins.dropbear.id.au> References: <20030219223313.GA93707@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030219223313.GA93707@attbi.com>; from rodrigc@attbi.com on Wed, Feb 19, 2003 at 05:33:13PM -0500 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Feb 19, 2003 at 05:33:13PM -0500, Craig Rodrigues wrote: > Hi, > > On my -CURRENT system, WCHAR_MIN and WCHAR_MAX are not defined > in . > > What should they be defined to? > > On my Linux system, I see that they are defined as: > > #define __WCHAR_MIN (-2147483647l - 1l) > #define __WCHAR_MAX (2147483647l) > > 2147483647 is equal to 0x7FFFFFFF. > > In another library, I have seen them defined as: > > # define WCHAR_MIN ((wchar_t) 0) > # define WCHAR_MAX (~WCHAR_MIN) > > > What are the correct values for FreeBSD? The correct values are the same as Linux but without the 'l' suffix: #define WCHAR_MIN (-2147483647 - 1) #define WCHAR_MAX 2147483647 The second definition of WCHAR_MIN and WCHAR_MAX is incorrect because it uses casts in the expression; IIRC, it needs to be possible to use these values in preprocessor #if statements: #if WCHAR_MIN == 0 /* wchar_t is unsigned */ #endif I'll add a definition of WCHAR_MIN and WCHAR_MAX to as soon as I can find a clean (non-polluting) way of doing it. Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message