Index: configure =================================================================== --- configure (revision 205137) +++ configure (working copy) @@ -20650,7 +20650,7 @@ for ac_header in endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \ locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \ strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \ -sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \ +sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h uchar.h unistd.h \ wchar.h wctype.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` Index: configure.ac =================================================================== --- configure.ac (revision 205137) +++ configure.ac (working copy) @@ -229,7 +229,7 @@ AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \ locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \ strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \ -sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \ +sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h uchar.h unistd.h \ wchar.h wctype.h]) # Only do link tests if native. Else, hardcode. Index: acinclude.m4 =================================================================== --- acinclude.m4 (revision 205137) +++ acinclude.m4 (working copy) @@ -1926,6 +1926,45 @@ ]) dnl +dnl Check for uchar.h and usability. +dnl +AC_DEFUN([GLIBCXX_CHECK_CUCHAR], [ + + # Test uchar.h. + AC_MSG_CHECKING([for ISO C11 support for for C++11 ]) + AC_CHECK_HEADERS(uchar.h, ac_has_uchar_h=yes, ac_has_uchar_h=no) + AC_MSG_RESULT($ac_has_uchar_h) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + if test x"$ac_has_uchar_h" = x"yes"; then + AC_TRY_COMPILE([#include ], + [ + long i = __STD_UTF_16__; + long j = __STD_UTF_32__; + namespace test + { + using ::c16rtomb; + using ::c32rtomb; + using ::mbrtoc16; + using ::mbrtoc32; + } + ], [ac_c11_uchar_cxx11=yes], [ac_c11_uchar_cxx11=no]) + else + ac_c11_uchar_cxx11=no + fi + AC_MSG_RESULT($ac_c11_uchar_cxx11) + if test x"$ac_c11_uchar_cxx11" = x"yes"; then + AC_DEFINE(_GLIBCXX_USE_C11_UCHAR_CXX11, 1, + [Define if C11 functions in should be imported in + in namespace std.]) + fi + + AC_LANG_RESTORE +]) + +dnl dnl Check for what type of C headers to use. dnl dnl --enable-cheaders= [does stuff]. Index: config.h.in =================================================================== --- config.h.in (revision 205137) +++ config.h.in (working copy) @@ -445,6 +445,9 @@ /* Define to 1 if the target supports thread-local storage. */ #undef HAVE_TLS +/* Define to 1 if you have the header file. */ +#undef HAVE_UCHAR_H + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H Index: include/Makefile.am =================================================================== --- include/Makefile.am (revision 205137) +++ include/Makefile.am (working copy) @@ -669,6 +669,7 @@ ${c_base_srcdir}/cstring \ ${c_base_srcdir}/ctgmath \ ${c_base_srcdir}/ctime \ + ${c_base_srcdir}/cuchar \ ${c_base_srcdir}/cwchar \ ${c_base_srcdir}/cwctype Index: include/Makefile.in =================================================================== --- include/Makefile.in (revision 205137) +++ include/Makefile.in (working copy) @@ -936,6 +936,7 @@ ${c_base_srcdir}/cstring \ ${c_base_srcdir}/ctgmath \ ${c_base_srcdir}/ctime \ + ${c_base_srcdir}/cuchar \ ${c_base_srcdir}/cwchar \ ${c_base_srcdir}/cwctype Index: include/c/cuchar =================================================================== --- include/c/cuchar (revision 0) +++ include/c/cuchar (revision 0) @@ -0,0 +1,49 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 2013 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This 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 General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +// +// ISO C++ 14882: 21.4 +// + +#ifndef _GLIBCXX_CUCHAR +#define _GLIBCXX_CUCHAR 1 + +#pragma GCC system_header + +#if __cplusplus < 201103L +# include +#else + +#include +#include + +#if _GLIBCXX_USE_C11_UCHAR_CXX11 +#include_next +#else +#warning Library support for cuchar (uchar.h) is not available. +#endif + +#endif // C++11 + +#endif // _GLIBCXX_CUCHAR Index: include/c_global/cuchar =================================================================== --- include/c_global/cuchar (revision 0) +++ include/c_global/cuchar (revision 0) @@ -0,0 +1,78 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 2013 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This 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 General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file include/cuchar + * This is a Standard C++ Library file. You should @c \#include this file + * in your programs, rather than any of the @a *.h implementation files. + * + * This is the C++ version of the Standard C Library header @c uchar.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std (except for names which are defined + * as macros in C). + */ + +// +// ISO C++ 14882: 21.4 +// + +#ifndef _GLIBCXX_CUCHAR +#define _GLIBCXX_CUCHAR 1 + +#pragma GCC system_header + +#if __cplusplus < 201103L +# include +#else + +#include +#include + +#if _GLIBCXX_USE_C11_UCHAR_CXX11 +#include + +// Get rid of those macros defined in in lieu of real functions. +#undef mbrtoc16 +#undef c16rtomb +#undef mbrtoc32 +#undef c32rtomb + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + using ::mbrtoc16; + using ::c16rtomb; + using ::mbrtoc32; + using ::c32rtomb; + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std + +#else +#warning Library support for cuchar (uchar.h) is not available. +#endif // _GLIBCXX_USE_C11_UCHAR_CXX11 + +#endif // C++11 + +#endif // _GLIBCXX_CUCHAR Index: include/c_std/cuchar =================================================================== --- include/c_std/cuchar (revision 0) +++ include/c_std/cuchar (revision 0) @@ -0,0 +1,78 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 2013 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This 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 General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file include/cuchar + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the @a *.h implementation files. + * + * This is the C++ version of the Standard C Library header @c uchar.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std (except for names which are defined + * as macros in C). + */ + +// +// ISO C++ 14882: 21.4 +// + +#ifndef _GLIBCXX_CUCHAR +#define _GLIBCXX_CUCHAR 1 + +#pragma GCC system_header + +#if __cplusplus < 201103L +# include +#else + +#include +#include + +#if _GLIBCXX_USE_C11_UCHAR_CXX11 +#include + +// Get rid of those macros defined in in lieu of real functions. +#undef mbrtoc16 +#undef c16rtomb +#undef mbrtoc32 +#undef c32rtomb + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + using ::mbrtoc16; + using ::c16rtomb; + using ::mbrtoc32; + using ::c32rtomb; + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std + +#else +#warning Library support for cuchar (uchar.h) is not available. +#endif // _GLIBCXX_USE_C11_UCHAR_CXX11 + +#endif // C++11 + +#endif // _GLIBCXX_CUCHAR Index: include/precompiled/stdc++.h =================================================================== --- include/precompiled/stdc++.h (revision 205137) +++ include/precompiled/stdc++.h (working copy) @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #endif Index: testsuite/17_intro/headers/c++200x/stdc++.cc =================================================================== --- testsuite/17_intro/headers/c++200x/stdc++.cc (revision 205137) +++ testsuite/17_intro/headers/c++200x/stdc++.cc (working copy) @@ -59,6 +59,9 @@ #include #endif #include +#ifdef _GLIBCXX_HAVE_UCHAR_H +#include +#endif #ifdef _GLIBCXX_HAVE_WCHAR_H #include #endif Index: testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc =================================================================== --- testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc (revision 205137) +++ testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc (working copy) @@ -59,6 +59,9 @@ #include #endif #include +#ifdef _GLIBCXX_HAVE_UCHAR_H +#include +#endif #ifdef _GLIBCXX_HAVE_WCHAR_H #include #endif @@ -103,6 +106,9 @@ #include #endif #include +#ifdef _GLIBCXX_HAVE_UCHAR_H +#include +#endif #ifdef _GLIBCXX_HAVE_WCHAR_H #include #endif