[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r16525 - in /trunk: ./ libc/ libc/assert/ libc/debug/ libc/iconv/ libc/include/ libc/libio/ libc/malloc/ libc/posix/ libc/st...



Author: joseph
Date: Wed Jan  4 16:32:13 2012
New Revision: 16525

Log:
Merge changes between r16494 and r16524 from /fsf/trunk.

Added:
    trunk/libc/sysdeps/unix/sysv/linux/timespec_get.c
      - copied unchanged from r16524, fsf/trunk/libc/sysdeps/unix/sysv/linux/timespec_get.c
    trunk/libc/sysdeps/unix/sysv/linux/x86_64/timespec_get.c
      - copied unchanged from r16524, fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/timespec_get.c
    trunk/libc/time/timespec_get.c
      - copied unchanged from r16524, fsf/trunk/libc/time/timespec_get.c
    trunk/libc/wcsmbs/c16rtomb.c
      - copied unchanged from r16524, fsf/trunk/libc/wcsmbs/c16rtomb.c
    trunk/libc/wcsmbs/mbrtoc16.c
      - copied unchanged from r16524, fsf/trunk/libc/wcsmbs/mbrtoc16.c
    trunk/libc/wcsmbs/uchar.h
      - copied unchanged from r16524, fsf/trunk/libc/wcsmbs/uchar.h
Modified:
    trunk/   (props changed)
    trunk/libc/ChangeLog
    trunk/libc/NEWS
    trunk/libc/Versions.def
    trunk/libc/assert/assert.h
    trunk/libc/debug/tst-chk1.c
    trunk/libc/iconv/gconv_builtin.h
    trunk/libc/iconv/gconv_int.h
    trunk/libc/iconv/gconv_simple.c
    trunk/libc/iconv/loop.c
    trunk/libc/include/features.h
    trunk/libc/libio/stdio.h
    trunk/libc/malloc/Versions
    trunk/libc/malloc/malloc.c
    trunk/libc/posix/regcomp.c
    trunk/libc/stdio-common/tst-gets.c
    trunk/libc/stdlib/stdlib.h
    trunk/libc/time/Makefile
    trunk/libc/time/Versions
    trunk/libc/time/time.h
    trunk/libc/version.h
    trunk/libc/wcsmbs/Makefile
    trunk/libc/wcsmbs/Versions
    trunk/libc/wcsmbs/mbrtowc.c
    trunk/libc/wcsmbs/wchar.h
    trunk/libc/wcsmbs/wcrtomb.c
    trunk/libc/wcsmbs/wcsmbsload.c
    trunk/libc/wcsmbs/wcsmbsload.h
    trunk/ports/ChangeLog.mips
    trunk/ports/sysdeps/mips/Makefile

Propchange: trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan  4 16:32:13 2012
@@ -1,1 +1,1 @@
-/fsf/trunk:15224-16494
+/fsf/trunk:15224-16524

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Wed Jan  4 16:32:13 2012
@@ -1,3 +1,10 @@
+2012-01-03  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* iconv/loop.c (single loop): Fix assertion in storing of
+	remaining bytes.
+
+	* posix/regcomp.c (init_word_char): Optimize a bit for sane encodings.
+
 2012-01-01  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	* posix/getconf.c: Update copyright year.
@@ -26,7 +33,63 @@
 	* posix/regex_internal.c (re_string_fetch_byte_case): Remove
 	pure attribute.
 
+2011-12-24  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* iconv/gconv_simple.c: Add ASCII<->UTF-16 transformations.
+	* iconv/gconv_builtin.h: Add entries for internal ASCII<->UTF-16
+	transformations.
+	* iconv/gconv_int.h: Likewise.
+	* wcsmbs/Makefile (routines): Add mbrtoc16 and c16rtomb.
+	* wcsmbs/Versions: Export mbrtoc16, c16rtomb, mbrtoc32, c32rtomb
+	from libc for GLIBC_2.16.
+	* wcsmbs/mbrtowc.c: Define mbrtoc32 alias.
+	* wcsmbs/wcrtomb.c: Define c32rtomb alias.
+	* wcsmbs/uchar.h: Really define mbstate_t.
+	* wcsmbs/wchar.h: Allow defining mbstate_t in uchar.h.
+	* wcsmbs/c16rtomb.c: New file.
+	* wcsmbs/mbrtoc16.c: New file.
+	* wcsmbs/wcsmbsload.c: Add static definitions for c16 conversions
+	for C/POSIX locale.
+	(__wcsmbs_load_conv): Do not fill in c16 routines yet.
+	* wcsmbs/wcsmbsload.h (gconv_fcts): Add entries for c16 routines.
+
+	* wcsmbs/wchar.h: Add missing __restrict.
+
 2011-12-23  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #13532]
+	* time/Makefile (routines): Add timespec_get.
+	* time/Versions: Export timespec_get from libc for GLIBC_2.16.
+	* time/time.h: Define TIME_UTC and declare timespec_get.  Define
+	timespec for ISO C11.
+	* time/timespec_get.c: New file.
+	* sysdeps/unix/sysv/linux/timespec_get.c: New file.
+	* sysdeps/unix/sysv/linux/x86_64/timespec_get.c: New file.
+
+	[BZ #13531]
+	* malloc/malloc.c: Define alias aligned_alloc for public_mEMALIGn.
+	* stdlib/stdlib.h: Declare aligned_alloc.
+	* Versions.def: Add GLIBC_2.16 for libc.
+	* malloc/Versions: Export aligned_alloc from libc for GLIBC_2.16.
+
+	[BZ 13527]
+	* stdlib/stdlib.h: Make at_quick_exit and quick_exit available for
+	ISO C11.
+
+	* include/features.h: Define __USE_ISOCXX11 when compiling ISO C++11
+	code.
+
+	[BZ #13528]
+	* libio/stdio.h: Do not declare gets for ISO C11 and _GNU_SOURCE.
+
+	[BZ #13529]
+	* assert/assert.h (static_assert): Define.
+
+	* version.h: Update for 2.16 development version.
+
+	[BZ #13526]
+	* include/features.h: Handle __STDC_VERSION__ >= 201112 and
+	_ISOC11_SOURCE.
 
 	* version.h (RELEASE): Bump for 2.15 release.
 	* include/features.h (__GLIBC_MINOR__): Bump to 15.

Modified: trunk/libc/NEWS
==============================================================================
--- trunk/libc/NEWS (original)
+++ trunk/libc/NEWS Wed Jan  4 16:32:13 2012
@@ -4,6 +4,27 @@
 
 Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/>
 using `glibc' in the "product" field.
+
+Version 2.16
+
+* The following bugs are resolved with this release:
+
+  13526, 13527, 13528, 13529, 13531, 13532
+
+* ISO C11 support:
+
+  + define static_assert
+
+  + do not declare gets
+
+  + declare at_quick_exit and quick_exit also for ISO C11
+
+  + aligned_alloc.  NB: The code is deliberately allows the size parameter
+    to not be a multiple of the alignment.  This is a moronic requirement
+    in the standard but it is only a requirement on the caller, not the
+    implementation.
+
+  + timespec_get added
 
 Version 2.15
 

Modified: trunk/libc/Versions.def
==============================================================================
--- trunk/libc/Versions.def (original)
+++ trunk/libc/Versions.def Wed Jan  4 16:32:13 2012
@@ -32,6 +32,7 @@
   GLIBC_2.13
   GLIBC_2.14
   GLIBC_2.15
+  GLIBC_2.16
   HURD_CTHREADS_0.3
 %ifdef EXPORT_UNWIND_FIND_FDE
   GCC_3.0

Modified: trunk/libc/assert/assert.h
==============================================================================
--- trunk/libc/assert/assert.h (original)
+++ trunk/libc/assert/assert.h Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1994-2001,2003,2004,2007
+/* Copyright (C) 1991,1992,1994-2001,2003,2004,2007,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -113,3 +113,10 @@
 # endif
 
 #endif /* NDEBUG.  */
+
+
+#ifdef __USE_ISOC11
+/* Static assertion.  Requires support in the compiler.  */
+# undef static_assert
+# define static_assert _Static_assert
+#endif

Modified: trunk/libc/debug/tst-chk1.c
==============================================================================
--- trunk/libc/debug/tst-chk1.c (original)
+++ trunk/libc/debug/tst-chk1.c Wed Jan  4 16:32:13 2012
@@ -33,6 +33,12 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <gnu/option-groups.h>
+
+__BEGIN_DECLS
+/* The <stdio.h> header does not include the declaration for gets
+   anymore when compiling with _GNU_SOURCE.  Provide a copy here.  */
+extern char *gets (char *__s);
+__END_DECLS
 
 #define obstack_chunk_alloc malloc
 #define obstack_chunk_free free

Modified: trunk/libc/iconv/gconv_builtin.h
==============================================================================
--- trunk/libc/iconv/gconv_builtin.h (original)
+++ trunk/libc/iconv/gconv_builtin.h Wed Jan  4 16:32:13 2012
@@ -1,5 +1,5 @@
 /* Builtin transformations.
-   Copyright (C) 1997-1999, 2000-2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-1999, 2000-2002, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -122,3 +122,24 @@
 			__gconv_transform_internal_ucs2reverse, NULL,
 			4, 4, 2, 2)
 #endif
+
+
+BUILTIN_TRANSFORMATION ("ANSI_X3.4-1968//", "UTF-16//", 1, "=ascii->UTF-16",
+			__gconv_transform_ascii_utf16, NULL, 2, 2, 1, 1)
+
+BUILTIN_TRANSFORMATION ("UTF-16//", "ANSI_X3.4-1968//", 1, "=UTF-16->ascii",
+			__gconv_transform_utf16_ascii, NULL, 2, 2, 1, 1)
+
+#if BYTE_ORDER == BIG_ENDIAN
+BUILTIN_TRANSFORMATION ("ANSI_X3.4-1968//", "UTF-16BE//", 1, "=ascii->UTF-16BE",
+			__gconv_transform_ascii_utf16, NULL, 2, 2, 1, 1)
+
+BUILTIN_TRANSFORMATION ("UTF-16BE//", "ANSI_X3.4-1968//", 1, "=UTF-16BE->ascii",
+			__gconv_transform_utf16_ascii, NULL, 2, 2, 1, 1)
+#else
+BUILTIN_TRANSFORMATION ("ANSI_X3.4-1968//", "UTF-16LE//", 1, "=ascii->UTF-16LE",
+			__gconv_transform_ascii_utf16, NULL, 2, 2, 1, 1)
+
+BUILTIN_TRANSFORMATION ("UTF-16LE//", "ANSI_X3.4-1968//", 1, "=UTF-16LE->ascii",
+			__gconv_transform_utf16_ascii, NULL, 2, 2, 1, 1)
+#endif

Modified: trunk/libc/iconv/gconv_int.h
==============================================================================
--- trunk/libc/iconv/gconv_int.h (original)
+++ trunk/libc/iconv/gconv_int.h Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2005, 2006, 2007, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -303,6 +303,8 @@
 __BUILTIN_TRANSFORM (__gconv_transform_ucs4le_internal);
 __BUILTIN_TRANSFORM (__gconv_transform_internal_utf16);
 __BUILTIN_TRANSFORM (__gconv_transform_utf16_internal);
+__BUILTIN_TRANSFORM (__gconv_transform_ascii_utf16);
+__BUILTIN_TRANSFORM (__gconv_transform_utf16_ascii);
 # undef __BUITLIN_TRANSFORM
 
 /* Specialized conversion function for a single byte to INTERNAL, recognizing

Modified: trunk/libc/iconv/gconv_simple.c
==============================================================================
--- trunk/libc/iconv/gconv_simple.c (original)
+++ trunk/libc/iconv/gconv_simple.c Wed Jan  4 16:32:13 2012
@@ -1,5 +1,5 @@
 /* Simple transformations functions.
-   Copyright (C) 1997-2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1997-2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -965,7 +965,7 @@
 	    cnt = 2;							      \
 	    ch &= 0x1f;							      \
 	  }								      \
-        else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))		      \
+	else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))		      \
 	  {								      \
 	    /* We expect three bytes.  */				      \
 	    cnt = 3;							      \
@@ -1221,7 +1221,7 @@
     else								      \
       {									      \
 	put16 (outptr, val);						      \
-        outptr += sizeof (uint16_t);					      \
+	outptr += sizeof (uint16_t);					      \
 	inptr += 4;							      \
       }									      \
   }
@@ -1320,3 +1320,72 @@
 #define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 #include <iconv/skeleton.c>
+
+
+/* Convert from ISO 646-IRV to UTF-16.  */
+#define DEFINE_INIT		0
+#define DEFINE_FINI		0
+#define MIN_NEEDED_FROM		1
+#define MIN_NEEDED_TO		2
+#define FROM_DIRECTION		1
+#define FROM_LOOP		ascii_utf16_loop
+#define TO_LOOP			ascii_utf16_loop /* This is not used.  */
+#define FUNCTION_NAME		__gconv_transform_ascii_utf16
+#define ONE_DIRECTION		1
+
+#define MIN_NEEDED_INPUT	MIN_NEEDED_FROM
+#define MIN_NEEDED_OUTPUT	MIN_NEEDED_TO
+#define LOOPFCT			FROM_LOOP
+#define BODY \
+  {									      \
+    if (__builtin_expect (*inptr > '\x7f', 0))				      \
+      {									      \
+	/* The value is too large.  We don't try transliteration here since   \
+	   this is not an error because of the lack of possibilities to	      \
+	   represent the result.  This is a genuine bug in the input since    \
+	   ASCII does not allow such values.  */			      \
+	STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
+      }									      \
+    else								      \
+      {									      \
+	/* It's an one byte sequence.  */				      \
+	*((uint16_t *) outptr) = *inptr++;				      \
+	outptr += sizeof (uint16_t);					      \
+      }									      \
+  }
+#define LOOP_NEED_FLAGS
+#include <iconv/loop.c>
+#include <iconv/skeleton.c>
+
+
+/* Convert from UTF-16 to ISO 646-IRV.  */
+#define DEFINE_INIT		0
+#define DEFINE_FINI		0
+#define MIN_NEEDED_FROM		2
+#define MIN_NEEDED_TO		1
+#define FROM_DIRECTION		1
+#define FROM_LOOP		utf16_ascii_loop
+#define TO_LOOP			utf16_ascii_loop /* This is not used.  */
+#define FUNCTION_NAME		__gconv_transform_utf16_ascii
+#define ONE_DIRECTION		1
+
+#define MIN_NEEDED_INPUT	MIN_NEEDED_FROM
+#define MIN_NEEDED_OUTPUT	MIN_NEEDED_TO
+#define LOOPFCT			FROM_LOOP
+#define BODY \
+  {									      \
+    if (__builtin_expect (*((const uint16_t *) inptr) > 0x7f, 0))	      \
+      {									      \
+	UNICODE_TAG_HANDLER (*((const uint16_t *) inptr), 2);		      \
+	STANDARD_TO_LOOP_ERR_HANDLER (2);				      \
+      }									      \
+    else								      \
+      {									      \
+	/* It's an one byte sequence.  */				      \
+	*outptr++ = *((const uint16_t *) inptr);			      \
+	inptr += sizeof (uint16_t);					      \
+      }									      \
+  }
+#define LOOP_NEED_FLAGS
+#include <iconv/loop.c>
+#include <iconv/skeleton.c>

Modified: trunk/libc/iconv/loop.c
==============================================================================
--- trunk/libc/iconv/loop.c (original)
+++ trunk/libc/iconv/loop.c Wed Jan  4 16:32:13 2012
@@ -1,5 +1,5 @@
 /* Conversion loop frame work.
-   Copyright (C) 1998-2003, 2005, 2008, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1998-2003, 2005, 2008, 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -390,6 +390,7 @@
   UNPACK_BYTES
 #else
   /* Add the bytes from the state to the input buffer.  */
+  assert ((state->__count & 7) <= sizeof (state->__value));
   for (inlen = 0; inlen < (size_t) (state->__count & 7); ++inlen)
     bytebuf[inlen] = state->__value.__wchb[inlen];
 #endif
@@ -474,7 +475,7 @@
       /* We don't have enough input for another complete input
 	 character.  */
       assert (inend - inptr > (state->__count & ~7));
-      assert (inend - inptr <= 7);
+      assert (inend - inptr <= sizeof (state->__value));
       state->__count = (state->__count & ~7) | (inend - inptr);
       inlen = 0;
       while (inptr < inend)

Modified: trunk/libc/include/features.h
==============================================================================
--- trunk/libc/include/features.h (original)
+++ trunk/libc/include/features.h Wed Jan  4 16:32:13 2012
@@ -25,6 +25,7 @@
 
    __STRICT_ANSI__	ISO Standard C.
    _ISOC99_SOURCE	Extensions to ISO C89 from ISO C99.
+   _ISOC11_SOURCE	Extensions to ISO C99 from ISO C11.
    _POSIX_SOURCE	IEEE Std 1003.1.
    _POSIX_C_SOURCE	If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
 			if >=199309L, add IEEE Std 1003.1b-1993;
@@ -57,6 +58,7 @@
    These are defined by this file and are used by the
    header files to decide what to declare or define:
 
+   __USE_ISOC11		Define ISO C11 things.
    __USE_ISOC99		Define ISO C99 things.
    __USE_ISOC95		Define ISO C90 AMD1 (C95) things.
    __USE_POSIX		Define IEEE Std 1003.1 things.
@@ -95,8 +97,10 @@
 
 
 /* Undefine everything, so we get a clean slate.  */
+#undef	__USE_ISOC11
 #undef	__USE_ISOC99
 #undef	__USE_ISOC95
+#undef	__USE_ISOCXX11
 #undef	__USE_POSIX
 #undef	__USE_POSIX2
 #undef	__USE_POSIX199309
@@ -158,6 +162,8 @@
 # define _ISOC95_SOURCE	1
 # undef  _ISOC99_SOURCE
 # define _ISOC99_SOURCE	1
+# undef  _ISOC11_SOURCE
+# define _ISOC11_SOURCE	1
 # undef  _POSIX_SOURCE
 # define _POSIX_SOURCE	1
 # undef  _POSIX_C_SOURCE
@@ -185,19 +191,31 @@
 # define _SVID_SOURCE	1
 #endif
 
-/* This is to enable the ISO C99 extension.  Also recognize the old macro
-   which was used prior to the standard acceptance.  This macro will
-   eventually go away and the features enabled by default once the ISO C99
-   standard is widely adopted.  */
-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+/* This is to enable the ISO C11 extension.  */
+#if (defined _ISOC11_SOURCE \
+     || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
+# define __USE_ISOC11	1
+#endif
+
+/* This is to enable the ISO C99 extension.  */
+#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
      || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
 # define __USE_ISOC99	1
 #endif
 
 /* This is to enable the ISO C90 Amendment 1:1995 extension.  */
-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
      || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
 # define __USE_ISOC95	1
+#endif
+
+/* This is to enable compatibility for ISO C++11.
+
+   So far g++ does not provide a macro.  Check the temporary macro for
+   now, too.  */
+#if ((defined __cplusplus && __cplusplus >= 201103L)			      \
+     || defined __GXX_EXPERIMENTAL_CXX0X__)
+# define __USE_ISOCXX11	1
 #endif
 
 /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2

Modified: trunk/libc/libio/stdio.h
==============================================================================
--- trunk/libc/libio/stdio.h (original)
+++ trunk/libc/libio/stdio.h Wed Jan  4 16:32:13 2012
@@ -628,12 +628,18 @@
 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      __wur;
 
+#ifndef __USE_ISOC11
 /* Get a newline-terminated string from stdin, removing the newline.
    DO NOT USE THIS FUNCTION!!  There is no limit on how much it will read.
 
-   This function is a possible cancellation point and therefore not
-   marked with __THROW.  */
-extern char *gets (char *__s) __wur;
+   The function has been officially removed in ISO C11.  This opportunity
+   is used to also remove it from the GNU feature list.  It is now only
+   available when explicitly using an old ISO C, Unix, or POSIX standard.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern char *gets (char *__s) __wur __attribute_deprecated__;
+#endif
 __END_NAMESPACE_STD
 
 #ifdef __USE_GNU

Modified: trunk/libc/malloc/Versions
==============================================================================
--- trunk/libc/malloc/Versions (original)
+++ trunk/libc/malloc/Versions Wed Jan  4 16:32:13 2012
@@ -58,6 +58,9 @@
   GLIBC_2.10 {
     malloc_info;
   }
+  GLIBC_2.16 {
+    aligned_alloc;
+  }
   GLIBC_PRIVATE {
     # Internal startup hook for libpthread.
     __libc_malloc_pthread_startup;

Modified: trunk/libc/malloc/malloc.c
==============================================================================
--- trunk/libc/malloc/malloc.c (original)
+++ trunk/libc/malloc/malloc.c Wed Jan  4 16:32:13 2012
@@ -3124,6 +3124,8 @@
 	 ar_ptr == arena_for_chunk(mem2chunk(p)));
   return p;
 }
+/* For ISO C11.  */
+weak_alias (public_mEMALIGn, aligned_alloc)
 libc_hidden_def (public_mEMALIGn)
 
 void*

Modified: trunk/libc/posix/regcomp.c
==============================================================================
--- trunk/libc/posix/regcomp.c (original)
+++ trunk/libc/posix/regcomp.c Wed Jan  4 16:32:13 2012
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2007,2009,2010,2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2007,2009,2010,2011,2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@xxxxxxxxxxxxxx>.
 
@@ -936,10 +936,38 @@
 internal_function
 init_word_char (re_dfa_t *dfa)
 {
-  int i, j, ch;
   dfa->word_ops_used = 1;
-  for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
-    for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+  int i = 0;
+  int ch = 0;
+  if (BE (dfa->map_notascii == 0, 1))
+    {
+      if (sizeof (dfa->word_char[0]) == 8)
+	{
+	  dfa->word_char[0] = UINT64_C (0x03ff000000000000);
+	  dfa->word_char[1] = UINT64_C (0x07fffffe87fffffe);
+	  i = 2;
+	}
+      else if (sizeof (dfa->word_char[0]) == 4)
+	{
+	  dfa->word_char[0] = UINT32_C (0x00000000);
+	  dfa->word_char[1] = UINT32_C (0x03ff0000);
+	  dfa->word_char[2] = UINT32_C (0x87fffffe);
+	  dfa->word_char[3] = UINT32_C (0x07fffffe);
+	  i = 4;
+	}
+      else
+	abort ();
+      ch = 128;
+
+      if (BE (dfa->is_utf8, 1))
+	{
+	  memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8);
+	  return;
+	}
+    }
+
+  for (; i < BITSET_WORDS; ++i)
+    for (int j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
       if (isalnum (ch) || ch == '_')
 	dfa->word_char[i] |= (bitset_word_t) 1 << j;
 }

Modified: trunk/libc/stdio-common/tst-gets.c
==============================================================================
--- trunk/libc/stdio-common/tst-gets.c (original)
+++ trunk/libc/stdio-common/tst-gets.c Wed Jan  4 16:32:13 2012
@@ -1,5 +1,5 @@
 /* Tests for gets.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2001.
 
@@ -20,6 +20,11 @@
 
 #include <stdio.h>
 #include <string.h>
+
+/* The <stdio.h> header does not include the declaration for gets
+   anymore when compiling with _GNU_SOURCE.  Provide a copy here.  */
+extern char *gets (char *__s);
+
 
 int
 main (void)

Modified: trunk/libc/stdlib/stdlib.h
==============================================================================
--- trunk/libc/stdlib/stdlib.h (original)
+++ trunk/libc/stdlib/stdlib.h Wed Jan  4 16:32:13 2012
@@ -509,6 +509,12 @@
      __THROW __nonnull ((1)) __wur;
 #endif
 
+#ifdef __USE_ISOC11
+/* ISO C variant of aligned allocation.  */
+extern void *aligned_alloc (size_t __alignment, size_t __size)
+     __THROW __wur __attribute__ ((__malloc__, __alloc_size__ (2)));
+#endif
+
 __BEGIN_NAMESPACE_STD
 /* Abort execution and generate a core-dump.  */
 extern void abort (void) __THROW __attribute__ ((__noreturn__));
@@ -517,9 +523,7 @@
 /* Register a function to be called when `exit' is called.  */
 extern int atexit (void (*__func) (void)) __THROW __nonnull ((1));
 
-#ifdef __USE_GNU
-// XXX There should be a macro to signal with C++ revision is used.
-// XXX This function is in the C++1x revision.
+#if defined __USE_ISOC11 || defined __USE_ISOCXX11
 /* Register a function to be called when `quick_exit' is called.  */
 # ifdef __cplusplus
 extern "C++" int at_quick_exit (void (*__func) (void))
@@ -543,9 +547,7 @@
    perform stdio cleanup, and terminate program execution with STATUS.  */
 extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
 
-#ifdef __USE_GNU
-// XXX There should be a macro to signal with C++ revision is used.
-// XXX This function is in the C++1x revision.
+#if defined __USE_ISOC11 || defined __USE_ISOCXX11
 /* Call all functions registered with `at_quick_exit' in the reverse
    of the order in which they were registered and terminate program
    execution with STATUS.  */

Modified: trunk/libc/time/Makefile
==============================================================================
--- trunk/libc/time/Makefile (original)
+++ trunk/libc/time/Makefile Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1991-2003, 2004, 2005, 2007, 2011 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
@@ -31,7 +31,8 @@
 	    tzfile getitimer setitimer			 \
 	    stime dysize timegm ftime			 \
 	    getdate strptime strptime_l			 \
-	    strftime strftime_l
+	    strftime strftime_l				 \
+	    timespec_get
 routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR)		 \
 	 := wcsftime wcsftime_l
 aux-$(OPTION_EGLIBC_LOCALE_CODE) += alt_digit era lc-time-cleanup

Modified: trunk/libc/time/Versions
==============================================================================
--- trunk/libc/time/Versions (original)
+++ trunk/libc/time/Versions Wed Jan  4 16:32:13 2012
@@ -62,4 +62,7 @@
   GLIBC_2.3.2 {
     strptime_l;
   }
+  GLIBC_2.16 {
+    timespec_get;
+  }
 }

Modified: trunk/libc/time/time.h
==============================================================================
--- trunk/libc/time/time.h (original)
+++ trunk/libc/time/time.h Wed Jan  4 16:32:13 2012
@@ -107,10 +107,11 @@
 #undef	__need_timer_t
 
 
-#if !defined __timespec_defined &&				\
-    ((defined _TIME_H &&					\
-      (defined __USE_POSIX199309 || defined __USE_MISC)) ||	\
-      defined __need_timespec)
+#if (!defined __timespec_defined					\
+     && ((defined _TIME_H						\
+	  && (defined __USE_POSIX199309 || defined __USE_MISC		\
+	      || defined __USE_ISOC11))					\
+	 || defined __need_timespec))
 # define __timespec_defined	1
 
 # include <bits/types.h>	/* This defines __time_t for us.  */
@@ -142,13 +143,13 @@
   int tm_yday;			/* Days in year.[0-365]	*/
   int tm_isdst;			/* DST.		[-1/0/1]*/
 
-#ifdef	__USE_BSD
+# ifdef	__USE_BSD
   long int tm_gmtoff;		/* Seconds east of UTC.  */
   __const char *tm_zone;	/* Timezone abbreviation.  */
-#else
+# else
   long int __tm_gmtoff;		/* Seconds east of UTC.  */
   __const char *__tm_zone;	/* Timezone abbreviation.  */
-#endif
+# endif
 };
 __END_NAMESPACE_STD
 #if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
@@ -156,7 +157,7 @@
 #endif
 
 
-#ifdef __USE_POSIX199309
+# ifdef __USE_POSIX199309
 /* POSIX.1b structure for timer start values and intervals.  */
 struct itimerspec
   {
@@ -167,14 +168,23 @@
 /* We can use a simple forward declaration.  */
 struct sigevent;
 
-#endif	/* POSIX.1b */
-
-#ifdef __USE_XOPEN2K
-# ifndef __pid_t_defined
+# endif	/* POSIX.1b */
+
+# ifdef __USE_XOPEN2K
+#  ifndef __pid_t_defined
 typedef __pid_t pid_t;
-#  define __pid_t_defined
-# endif
-#endif
+#   define __pid_t_defined
+#  endif
+# endif
+
+
+# ifdef __USE_ISOC11
+/* Time base values for timespec_get.  */
+enum
+  {
+    TIME_UTC = 1
+  };
+# endif
 
 
 __BEGIN_NAMESPACE_STD
@@ -351,6 +361,13 @@
 /* Return clock ID for CPU-time clock.  */
 extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
 #  endif
+
+
+# ifdef __USE_ISOC11
+/* Set TS to calendar time based in time base BASE.  */
+extern int timespec_get (struct timespec *__ts, int __base)
+     __THROW __nonnull ((1));
+# endif
 
 
 /* Create new per-process timer using CLOCK_ID.  */

Modified: trunk/libc/version.h
==============================================================================
--- trunk/libc/version.h (original)
+++ trunk/libc/version.h Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
 /* This file just defines the current version number of libc.  */
 
-#define RELEASE "stable"
-#define VERSION "2.15"
+#define RELEASE "development"
+#define VERSION "2.15.90"

Modified: trunk/libc/wcsmbs/Makefile
==============================================================================
--- trunk/libc/wcsmbs/Makefile (original)
+++ trunk/libc/wcsmbs/Makefile Wed Jan  4 16:32:13 2012
@@ -24,7 +24,7 @@
 
 subdir	:= wcsmbs
 
-headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h
+headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h
 distribute := wcwidth.h wcsmbsload.h
 
 # These functions are used by printf_fp.c, even in the plain case; see
@@ -45,7 +45,8 @@
 	    wcscoll_l wcsxfrm_l \
 	    wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
 	    wcsmbsload mbsrtowcs_l \
-	    isoc99_swscanf isoc99_vswscanf
+	    isoc99_swscanf isoc99_vswscanf \
+	    mbrtoc16 c16rtomb
 routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO)				\
 	 += isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf
 

Modified: trunk/libc/wcsmbs/Versions
==============================================================================
--- trunk/libc/wcsmbs/Versions (original)
+++ trunk/libc/wcsmbs/Versions Wed Jan  4 16:32:13 2012
@@ -28,4 +28,7 @@
     __isoc99_wscanf; __isoc99_vwscanf; __isoc99_fwscanf; __isoc99_vfwscanf;
     __isoc99_swscanf; __isoc99_vswscanf;
   }
+  GLIBC_2.16 {
+    mbrtoc16; c16rtomb; mbrtoc32; c32rtomb;
+  }
 }

Modified: trunk/libc/wcsmbs/mbrtowc.c
==============================================================================
--- trunk/libc/wcsmbs/mbrtowc.c (original)
+++ trunk/libc/wcsmbs/mbrtowc.c Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2004, 2005
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2004, 2005, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxx>, 1996.
@@ -117,3 +117,8 @@
 libc_hidden_def (__mbrtowc)
 weak_alias (__mbrtowc, mbrtowc)
 libc_hidden_weak (mbrtowc)
+
+/* There should be no difference between the UTF-32 handling required
+   by mbrtoc32 and the wchar_t handling which has long since been
+   implemented in mbrtowc.  */
+weak_alias (__mbrtowc, mbrtoc32)

Modified: trunk/libc/wcsmbs/wchar.h
==============================================================================
--- trunk/libc/wcsmbs/wchar.h (original)
+++ trunk/libc/wcsmbs/wchar.h Wed Jan  4 16:32:13 2012
@@ -77,8 +77,8 @@
 # endif
 #endif
 
-#if (defined _WCHAR_H || defined __need_mbstate_t) && !defined __mbstate_t_defined
-# define __mbstate_t_defined	1
+#if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined
+# define ____mbstate_t_defined	1
 /* Conversion state information.  */
 typedef struct
 {
@@ -101,10 +101,14 @@
    defined.  */
 #ifdef _WCHAR_H
 
+# ifndef __mbstate_t_defined
 __BEGIN_NAMESPACE_C99
 /* Public type.  */
 typedef __mbstate_t mbstate_t;
 __END_NAMESPACE_C99
+#  define __mbstate_t_defined 1
+# endif
+
 #ifdef __USE_GNU
 __USING_NAMESPACE_C99(mbstate_t)
 #endif
@@ -361,7 +365,7 @@
    to by S to PWC.  */
 extern size_t mbrtowc (wchar_t *__restrict __pwc,
 		       __const char *__restrict __s, size_t __n,
-		       mbstate_t *__p) __THROW;
+		       mbstate_t *__restrict __p) __THROW;
 
 /* Write multibyte representation of wide character WC to S.  */
 extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,

Modified: trunk/libc/wcsmbs/wcrtomb.c
==============================================================================
--- trunk/libc/wcsmbs/wcrtomb.c (original)
+++ trunk/libc/wcsmbs/wcrtomb.c Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,2000,2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998,2000,2002,2005,2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -115,3 +115,8 @@
 }
 weak_alias (__wcrtomb, wcrtomb)
 libc_hidden_weak (wcrtomb)
+
+/* There should be no difference between the UTF-32 handling required
+   by c32rtomb and the wchar_t handling which has long since been
+   implemented in wcrtomb.  */
+weak_alias (__wcrtomb, c32rtomb)

Modified: trunk/libc/wcsmbs/wcsmbsload.c
==============================================================================
--- trunk/libc/wcsmbs/wcsmbsload.c (original)
+++ trunk/libc/wcsmbs/wcsmbsload.c Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2002,2004,2005,2008,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2002,2004,2005,2008,2010,2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -68,6 +68,44 @@
   .__data = NULL
 };
 
+static const struct __gconv_step to_c16 =
+{
+  .__shlib_handle = NULL,
+  .__modname = NULL,
+  .__counter = INT_MAX,
+  .__from_name = (char *) "ANSI_X3.4-1968//TRANSLIT",
+  .__to_name = (char *) "UTF-16//",
+  .__fct = __gconv_transform_ascii_utf16,
+  .__btowc_fct = NULL,
+  .__init_fct = NULL,
+  .__end_fct = NULL,
+  .__min_needed_from = 1,
+  .__max_needed_from = 1,
+  .__min_needed_to = 4,
+  .__max_needed_to = 4,
+  .__stateful = 0,
+  .__data = NULL
+};
+
+static const struct __gconv_step from_c16 =
+{
+  .__shlib_handle = NULL,
+  .__modname = NULL,
+  .__counter = INT_MAX,
+  .__from_name = (char *) "UTF-16//",
+  .__to_name = (char *) "ANSI_X3.4-1968//TRANSLIT",
+  .__fct = __gconv_transform_utf16_ascii,
+  .__btowc_fct = NULL,
+  .__init_fct = NULL,
+  .__end_fct = NULL,
+  .__min_needed_from = 4,
+  .__max_needed_from = 4,
+  .__min_needed_to = 1,
+  .__max_needed_to = 1,
+  .__stateful = 0,
+  .__data = NULL
+};
+
 
 /* For the default locale we only have to handle ANSI_X3.4-1968.  */
 const struct gconv_fcts __wcsmbs_gconv_fcts_c =
@@ -75,7 +113,12 @@
   .towc = (struct __gconv_step *) &to_wc,
   .towc_nsteps = 1,
   .tomb = (struct __gconv_step *) &to_mb,
-  .tomb_nsteps = 1
+  .tomb_nsteps = 1,
+
+  .toc16 = (struct __gconv_step *) &to_c16,
+  .toc16_nsteps = 1,
+  .fromc16 = (struct __gconv_step *) &from_c16,
+  .fromc16_nsteps = 1,
 };
 
 
@@ -193,6 +236,12 @@
 					   &new_fcts->tomb_nsteps)
 			: NULL);
 
+      // XXX
+      new_fcts->toc16 = (struct __gconv_step *) &to_c16;
+      new_fcts->toc16_nsteps = 1;
+      new_fcts->fromc16 = (struct __gconv_step *) &from_c16;
+      new_fcts->fromc16_nsteps = 1;
+
       /* If any of the conversion functions is not available we don't
 	 use any since this would mean we cannot convert back and
 	 forth.*/
@@ -255,14 +304,36 @@
 __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name)
 {
   copy->towc = __wcsmbs_getfct ("INTERNAL", name, &copy->towc_nsteps);
-  if (copy->towc != NULL)
+  if (copy->towc == NULL)
+    return 1;
+
+  copy->tomb = __wcsmbs_getfct (name, "INTERNAL", &copy->tomb_nsteps);
+  if (copy->tomb == NULL)
+    goto out_mb;
+
+#if 0
+  copy->fromc16 = __wcsmbs_getfct (name, "UTF-16//", &copy->fromc16_nsteps);
+  if (copy->fromc16 == NULL)
+    goto out_fromc16;
+
+  copy->toc16 = __wcsmbs_getfct ("UTF-16//", name, &copy->toc16_nsteps);
+  if (copy->toc16 == NULL)
+#else
+  if (0)
+#endif
     {
-      copy->tomb = __wcsmbs_getfct (name, "INTERNAL", &copy->tomb_nsteps);
-      if (copy->tomb == NULL)
-	__gconv_close_transform (copy->towc, copy->towc_nsteps);
+#if 0
+      __gconv_close_transform (copy->fromc16, copy->fromc16_nsteps);
+    out_fromc16:
+      __gconv_close_transform (copy->tomb, copy->tomb_nsteps);
+#endif
+    out_mb:
+      __gconv_close_transform (copy->towc, copy->towc_nsteps);
+    out_wc:
+      return 1;
     }
 
-  return copy->towc == NULL || copy->tomb == NULL ? 1 : 0;
+  return 0;
 }
 
 void internal_function
@@ -277,6 +348,11 @@
       /* Free the old conversions.  */
       __gconv_close_transform (data->tomb, data->tomb_nsteps);
       __gconv_close_transform (data->towc, data->towc_nsteps);
+#if 0
+      // XXX
+      __gconv_close_transform (data->fromc16, data->fromc16_nsteps);
+      __gconv_close_transform (data->toc16, data->toc16c_nsteps);
+#endif
       free ((char *) data);
     }
 }

Modified: trunk/libc/wcsmbs/wcsmbsload.h
==============================================================================
--- trunk/libc/wcsmbs/wcsmbsload.h (original)
+++ trunk/libc/wcsmbs/wcsmbsload.h Wed Jan  4 16:32:13 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2002, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2002, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -32,6 +32,11 @@
     size_t towc_nsteps;
     struct __gconv_step *tomb;
     size_t tomb_nsteps;
+
+    struct __gconv_step *toc16;
+    size_t toc16_nsteps;
+    struct __gconv_step *fromc16;
+    size_t fromc16_nsteps;
   };
 
 /* Set of currently active conversion functions.  */

Modified: trunk/ports/ChangeLog.mips
==============================================================================
--- trunk/ports/ChangeLog.mips (original)
+++ trunk/ports/ChangeLog.mips Wed Jan  4 16:32:13 2012
@@ -1,3 +1,8 @@
+2012-01-04  Tom de Vries  <tom@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/Makefile: Compile initfini.c, pt-initfini.c with
+	-fno-unwind-tables.
+
 2012-01-03  Tom de Vries  <tom@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/mips/backtrace.c: New file, including ia64 backtrace.c.

Modified: trunk/ports/sysdeps/mips/Makefile
==============================================================================
--- trunk/ports/sysdeps/mips/Makefile (original)
+++ trunk/ports/sysdeps/mips/Makefile Wed Jan  4 16:32:13 2012
@@ -20,4 +20,12 @@
 CFLAGS-tst-backtrace6.c += -funwind-tables
 endif
 
+ifeq ($(subdir),csu)
+CFLAGS-initfini.s += -fno-unwind-tables
+endif
+
+ifeq ($(subdir),nptl)
+CFLAGS-pt-initfini.s += -fno-unwind-tables
+endif
+
 ASFLAGS-.os += $(pic-ccflag)

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits