Date: Sun, 3 Jun 2012 14:34:05 +1200 From: Andrew Turner <andrew@fubar.geek.nz> To: Bruce Evans <brde@optusnet.com.au> 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 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <brde@optusnet.com.au> 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 <wchar.h> */ /* 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120603143405.3b2fbcac>