From owner-svn-src-projects@FreeBSD.ORG Sun Jun 3 02:35:48 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF048106566B; Sun, 3 Jun 2012 02:35:48 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from mailfilter7.ihug.co.nz (mailfilter7.ihug.co.nz [203.109.136.7]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6948FC08; Sun, 3 Jun 2012 02:35:48 +0000 (UTC) X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=rGYBl-LCTwoA:10 a=3+1yDqSmWr2WFEp97EHcqg==:17 a=PO7r1zJSAAAA:8 a=-UPDqFNAEabFX9p2fyoA:9 a=CjuIK1q_8ugA:10 a=eX4oHM6-uBM6bsFTGF0A:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAFTMyk/LbdT8/2dsb2JhbAA/BrQigQiCGAEBBAFWIwULCAMOCiMLOR4GE4gGBLVuixEmhWoDjjeGYwGJIIR8gVqCdQ X-IronPort-AV: E=Sophos;i="4.75,705,1330858800"; d="diff'?scan'208";a="194945272" Received: from 203-109-212-252.dsl.dyn.ihug.co.nz (HELO localhost) ([203.109.212.252]) by cust.filter7.content.vf.net.nz with SMTP; 03 Jun 2012 14:34:38 +1200 Date: Sun, 3 Jun 2012 14:34:05 +1200 From: Andrew Turner To: Bruce Evans Message-ID: <20120603143405.3b2fbcac@fubar.geek.nz> In-Reply-To: <20120520165107.D822@besplex.bde.org> References: <201205192351.q4JNpnAq053531@svn.freebsd.org> <20120520165107.D822@besplex.bde.org> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.0) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/_AuLUcWMskKY0xPevRroGy0" Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235672 - in projects/arm_eabi/sys: amd64/include i386/include ia64/include mips/include pc98/include powerpc/include sparc64/include x86/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 02:35:48 -0000 --MP_/_AuLUcWMskKY0xPevRroGy0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sun, 20 May 2012 18:58:12 +1000 (EST) Bruce Evans wrote: > On Sat, 19 May 2012, Andrew Turner wrote: > > > Log: > > Fix wchar support in the not ARM case. > > > > * Add machine/_wchar.h to define WCHAR_{MIN,MAX} and include it > > from machine/_stdint.h, it is already in wchar.h. > > This adds 2 layers of include pessimizations to x86, though only 1 > layer to other arches. The pessimization is most noticeable over > nfs, where the RPCs for reopening include files can take 10-100 times > longer than actually reading and parsing of the files for small files. > > This has some style bugs. > > > * Add the typedef for __wchar_t to machine/_types.h. > > The limits should be defined (with leading underscores) here too, so > that no new includes are needed. How about the attached patch? It: * Removes machine/_wchar.h. * Moves the __wchar_t typedef to machine/_types.h. * Adds __WCHAR_MIN and __WCHAR_MAX to machine/_types.h and uses them where required. This is against head and only for sparc64. I will do the same on the other architectures. Andrew --MP_/_AuLUcWMskKY0xPevRroGy0 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=sparc64_wchar.diff Index: include/wchar.h =================================================================== --- include/wchar.h (revision 234300) +++ include/wchar.h (working copy) @@ -89,8 +89,8 @@ #endif #ifndef WCHAR_MIN -#define WCHAR_MIN __INT_MIN -#define WCHAR_MAX __INT_MAX +#define WCHAR_MIN __WCHAR_MIN +#define WCHAR_MAX __WCHAR_MAX #endif #ifndef WEOF Index: sys/sparc64/include/_stdint.h =================================================================== --- sys/sparc64/include/_stdint.h (revision 234300) +++ sys/sparc64/include/_stdint.h (working copy) @@ -151,8 +151,8 @@ #ifndef WCHAR_MIN /* Also possibly defined in */ /* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX +#define WCHAR_MIN __WCHAR_MIN +#define WCHAR_MAX __WCHAR_MIN #endif /* Limits of wint_t. */ Index: sys/sparc64/include/_types.h =================================================================== --- sys/sparc64/include/_types.h (revision 234300) +++ sys/sparc64/include/_types.h (working copy) @@ -92,7 +92,11 @@ typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; +typedef int __wchar_t; +#define __WCHAR_MIN __INT_MIN +#define __WCHAR_MAX __INT_MAX + /* * Unusual type definitions. */ Index: sys/sys/_types.h =================================================================== --- sys/sys/_types.h (revision 234300) +++ sys/sys/_types.h (working copy) @@ -87,7 +87,6 @@ */ typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __rune_t; /* rune_t (see above) */ -typedef __ct_rune_t __wchar_t; /* wchar_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ typedef __uint32_t __dev_t; /* device number */ --MP_/_AuLUcWMskKY0xPevRroGy0--