From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112072 invoked by alias); 4 Sep 2015 11:13:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 112051 invoked by uid 89); 4 Sep 2015 11:13:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS,URIBL_BLACK autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 04 Sep 2015 11:13:28 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 560158F31B; Fri, 4 Sep 2015 11:13:27 +0000 (UTC) Received: from localhost (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84BDQYT007295; Fri, 4 Sep 2015 07:13:26 -0400 Date: Fri, 04 Sep 2015 11:18:00 -0000 From: Jonathan Wakely To: Ed Smith-Rowland <3dw4rd@verizon.net> Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: [v3 PATCH] Add C++11 Message-ID: <20150904111325.GA2631@redhat.com> References: <55CCABBF.50402@verizon.net> <20150813145119.GJ29652@redhat.com> <55CE0B89.8020705@verizon.net> <55CE10C4.9090005@verizon.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="GVLQrlG8+/jMfW4X" Content-Disposition: inline In-Reply-To: <55CE10C4.9090005@verizon.net> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-09/txt/msg00338.txt.bz2 --GVLQrlG8+/jMfW4X Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-length: 875 On 14/08/15 12:01 -0400, Ed Smith-Rowland wrote: >OK. > >This tested clean because it didn't install the headers. > >So Jonathan. I am going to throw in the sponge on the configury. > >Could you have a look and carry this over the finish line? The main problem was in acinclude.m4: + GLIBCXX_CONDITIONAL(ENABLE_CUCHAR, test $enable_libstdcxx_cuchar = yes) Nothing set enable_libstdcxx_cuchar, so the conditional was false, and so the headers weren't installed due to: +if ENABLE_CUCHAR +c_base_cuchar_header = ${c_base_srcdir}/cuchar +c_compatibility_cuchar_header = ${c_compatibility_srcdir}/uchar.h +else +c_base_cuchar_header = +c_compatibility_cuchar_header = +endif I've attached what I'm committing, which has a few tweaks but is substantially the same as your last patch. Thanks for adding this missing feature! Tested powerpc64le-linux, committed to trunk. --GVLQrlG8+/jMfW4X Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Content-length: 13428 commit 7a0a6889a1e348c1bc3980e0417dc3b4fbf2192d Author: Jonathan Wakely Date: Fri Sep 4 11:27:08 2015 +0100 Add C++11 header . 2015-09-04 Edward Smith-Rowland <3dw4rd@verizon.net> Jonathan Wakely * acinclude.m4 (GLIBCXX_CHECK_UCHAR_H): Define. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac: Check for . * include/Makefile.am: Add new headers. * include/Makefile.in: Regenerate. * include/c/cuchar: New. * include/c_compatibility/uchar.h: New. * include/c_global/cuchar: New. * include/c_std/cuchar: New. * include/precompiled/stdc++.h: Include . * testsuite/17_intro/headers/c++200x/stdc++.cc: Include . * testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc: Include . diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 789bc58..64c9b7e 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1809,6 +1809,52 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ ]) dnl +dnl Check for uchar.h and usability. +dnl +AC_DEFUN([GLIBCXX_CHECK_UCHAR_H], [ + + # Test uchar.h. + AC_CHECK_HEADERS(uchar.h, ac_has_uchar_h=yes, ac_has_uchar_h=no) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=c++11" + + if test x"$ac_has_uchar_h" = x"yes"; then + AC_MSG_CHECKING([for ISO C11 support for ]) + AC_TRY_COMPILE([#include + #ifdef __STDC_UTF_16__ + long i = __STDC_UTF_16__; + #endif + #ifdef __STDC_UTF_32__ + long j = __STDC_UTF_32__; + #endif + 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 into + namespace std in .]) + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + + +dnl dnl Check whether "/dev/random" and "/dev/urandom" are available for the dnl random_device of "TR1" (Chapter 5.1, "Random number generation"). dnl diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 96ff16f..3456348 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -181,6 +181,7 @@ GLIBCXX_ENABLE_VTABLE_VERIFY([no]) # Checks for operating systems support that doesn't require linking. GLIBCXX_CHECK_STDIO_PROTO GLIBCXX_CHECK_SYSTEM_ERROR +GLIBCXX_CHECK_UCHAR_H # For the streamoff typedef. GLIBCXX_CHECK_INT64_T diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 41fc4af..e579b22 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -710,6 +710,7 @@ c_base_headers = \ ${c_base_srcdir}/cstring \ ${c_base_srcdir}/ctgmath \ ${c_base_srcdir}/ctime \ + ${c_base_srcdir}/cuchar \ ${c_base_srcdir}/cwchar \ ${c_base_srcdir}/cwctype @@ -752,6 +753,7 @@ c_compatibility_headers = \ ${c_compatibility_srcdir}/string.h \ ${c_compatibility_srcdir}/tgmath.h \ ${c_compatibility_srcdir}/time.h \ + ${c_compatibility_srcdir}/uchar.h \ ${c_compatibility_srcdir}/wchar.h \ ${c_compatibility_srcdir}/wctype.h endif diff --git a/libstdc++-v3/include/c/cuchar b/libstdc++-v3/include/c/cuchar new file mode 100644 index 0000000..dd50c47 --- /dev/null +++ b/libstdc++-v3/include/c/cuchar @@ -0,0 +1,47 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 2015 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:2011 21.8 +// + +#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 +#endif + +#endif // C++11 + +#endif // _GLIBCXX_CUCHAR diff --git a/libstdc++-v3/include/c_compatibility/uchar.h b/libstdc++-v3/include/c_compatibility/uchar.h new file mode 100644 index 0000000..746f4af --- /dev/null +++ b/libstdc++-v3/include/c_compatibility/uchar.h @@ -0,0 +1,45 @@ +// -*- C++ -*- compatibility header. + +// Copyright (C) 2015 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 uchar.h + * This is a Standard C++ Library header. + */ + +#include + +#ifndef _GLIBCXX_UCHAR_H +#define _GLIBCXX_UCHAR_H 1 + +#ifdef _GLIBCXX_NAMESPACE_C + +#if _GLIBCXX_USE_C11_UCHAR_CXX11 +using std::mbrtoc16; +using std::c16rtomb; +using std::mbrtoc32; +using std::c32rtomb; +#endif // _GLIBCXX_USE_C11_UCHAR_CXX11 + +#endif // _GLIBCXX_NAMESPACE_C + +#endif // _GLIBCXX_UCHAR_H diff --git a/libstdc++-v3/include/c_global/cuchar b/libstdc++-v3/include/c_global/cuchar new file mode 100644 index 0000000..3b30c6a --- /dev/null +++ b/libstdc++-v3/include/c_global/cuchar @@ -0,0 +1,77 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 2015 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:2011 21.8 +// + +#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 + +#endif // _GLIBCXX_USE_C11_UCHAR_CXX11 + +#endif // C++11 + +#endif // _GLIBCXX_CUCHAR diff --git a/libstdc++-v3/include/c_std/cuchar b/libstdc++-v3/include/c_std/cuchar new file mode 100644 index 0000000..7d5eedb --- /dev/null +++ b/libstdc++-v3/include/c_std/cuchar @@ -0,0 +1,77 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 2015 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:2011 21.8 +// + +#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 + +#endif // _GLIBCXX_USE_C11_UCHAR_CXX11 + +#endif // C++11 + +#endif // _GLIBCXX_CUCHAR diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h index 693391a..ab119fe 100644 --- a/libstdc++-v3/include/precompiled/stdc++.h +++ b/libstdc++-v3/include/precompiled/stdc++.h @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #endif diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc index 50c3274..d1c64b1 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc @@ -59,6 +59,9 @@ #include #endif #include +#if __has_include() +#include +#endif #ifdef _GLIBCXX_HAVE_WCHAR_H #include #endif diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc index 9fa919f..e51bdee 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc @@ -59,6 +59,9 @@ #include #endif #include +#if __has_include() +#include +#endif #ifdef _GLIBCXX_HAVE_WCHAR_H #include #endif @@ -103,6 +106,9 @@ #include #endif #include +#if __has_include() +#include +#endif #ifdef _GLIBCXX_HAVE_WCHAR_H #include #endif --GVLQrlG8+/jMfW4X--