This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.17-157-g052aff9


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  052aff95782fefe9c63566471063e8b20836bfb8 (commit)
      from  7c1e01aabcec96173b6e276e67322125ec90dff7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=052aff95782fefe9c63566471063e8b20836bfb8

commit 052aff95782fefe9c63566471063e8b20836bfb8
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jan 23 00:42:51 2013 +0000

    Make bits/wchar.h correct for all architectures (bug 15036).

diff --git a/ChangeLog b/ChangeLog
index 7d8eaf7..3d378c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-01-23  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #15036]
+	* bits/wchar.h (__WCHAR_MAX): Define based on __WCHAR_MAX__, or
+	based on [L'\0' - 1 > 0] if [!__WCHAR_MAX__].
+	(__WCHAR_MIN): Likewise, using __WCHAR_MIN__.
+	* sysdeps/unix/sysv/linux/x86/bits/wchar.h: Remove.
+
 2013-01-21  David S. Miller  <davem@davemloft.net>
 
 	* sysdeps/sparc/backtrace.c: New file.
diff --git a/NEWS b/NEWS
index abbbbae..9a039d8 100644
--- a/NEWS
+++ b/NEWS
@@ -10,7 +10,7 @@ Version 2.18
 * The following bugs are resolved with this release:
 
   13951, 14200, 14317, 14327, 14496, 14964, 14981, 14982, 14985, 14994,
-  14996, 15003, 15020, 15023.
+  14996, 15003, 15020, 15023, 15036.
 
 
 Version 2.17
diff --git a/bits/wchar.h b/bits/wchar.h
index eb07151..ef93d0e 100644
--- a/bits/wchar.h
+++ b/bits/wchar.h
@@ -19,7 +19,31 @@
 #ifndef _BITS_WCHAR_H
 #define _BITS_WCHAR_H	1
 
-#define __WCHAR_MIN	(-2147483647 - 1)
-#define __WCHAR_MAX	(2147483647)
+/* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__
+   are not defined, give the right value and type as long as both int
+   and wchar_t are 32-bit types.  Adding L'\0' to a constant value
+   ensures that the type is correct; it is necessary to use (L'\0' +
+   0) rather than just L'\0' so that the type in C++ is the promoted
+   version of wchar_t rather than the distinct wchar_t type itself.
+   Because wchar_t in preprocessor #if expressions is treated as
+   intmax_t or uintmax_t, the expression (L'\0' - 1) would have the
+   wrong value for WCHAR_MAX in such expressions and so cannot be used
+   to define __WCHAR_MAX in the unsigned case.  */
+
+#ifdef __WCHAR_MAX__
+# define __WCHAR_MAX	__WCHAR_MAX__
+#elif L'\0' - 1 > 0
+# define __WCHAR_MAX	(0xffffffffu + L'\0')
+#else
+# define __WCHAR_MAX	(0x7fffffff + L'\0')
+#endif
+
+#ifdef __WCHAR_MIN__
+# define __WCHAR_MIN	__WCHAR_MIN__
+#elif L'\0' - 1 > 0
+# define __WCHAR_MIN	(L'\0' + 0)
+#else
+# define __WCHAR_MIN	(-__WCHAR_MAX - 1)
+#endif
 
 #endif	/* bits/wchar.h */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/wchar.h b/sysdeps/unix/sysv/linux/x86/bits/wchar.h
deleted file mode 100644
index 16b8b77..0000000
--- a/sysdeps/unix/sysv/linux/x86/bits/wchar.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* wchar_t type related definitions.  i386/x86-64 version.
-   Copyright (C) 2000-2013 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _BITS_WCHAR_H
-#define _BITS_WCHAR_H	1
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __WCHAR_MIN	(-2147483647 - 1)
-# define __WCHAR_MAX	(2147483647)
-#else
-# define __WCHAR_MIN	(-2147483647l - 1l)
-# define __WCHAR_MAX	(2147483647l)
-#endif
-
-#endif	/* bits/wchar.h */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                |    8 +++++++
 NEWS                                     |    2 +-
 bits/wchar.h                             |   28 ++++++++++++++++++++++++-
 sysdeps/unix/sysv/linux/x86/bits/wchar.h |   32 ------------------------------
 4 files changed, 35 insertions(+), 35 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/x86/bits/wchar.h


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]