From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27323 invoked by alias); 1 Feb 2016 11:24:07 -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 27296 invoked by uid 89); 1 Feb 2016 11:24:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=26,12, cmath, _glibcxx_math_h, 2612 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; Mon, 01 Feb 2016 11:24:06 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0F19892A42; Mon, 1 Feb 2016 11:24:05 +0000 (UTC) Received: from localhost (ovpn-116-79.ams2.redhat.com [10.36.116.79]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11BO4q8004694; Mon, 1 Feb 2016 06:24:04 -0500 Date: Mon, 01 Feb 2016 11:24:00 -0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] libstdc++/69581 Don't define guard macros when doing #include_next in math.h and stdlib.h Message-ID: <20160201112403.GB3471@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-02/txt/msg00016.txt.bz2 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-length: 361 The new and wrapper headers should not define their guard macros when being included in "pass-through" mode, i.e. when _GLIBCXX_INCLUDE_NEXT_C_HEADERS is defined. This patch allows the wrapper to pass-through as many layers of wrapper headers as needed until the real C library header is found. Tested powerpc64-linux, committed to trunk. --uAKRQypu60I7Lcqm Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Content-length: 1929 commit c501dcd83400039b74f79f338580f25e148556ac Author: Jonathan Wakely Date: Mon Feb 1 10:53:35 2016 +0000 Don't define guard macros when doing #include_next in math.h and stdlib.h 2016-02-01 Bernd Edlinger PR libstdc++/69581 * include/c_compatibility/math.h: Move header guards. * include/c_compatibility/stdlib.h: Likewise. diff --git a/libstdc++-v3/include/c_compatibility/math.h b/libstdc++-v3/include/c_compatibility/math.h index 243e631..1f579ee 100644 --- a/libstdc++-v3/include/c_compatibility/math.h +++ b/libstdc++-v3/include/c_compatibility/math.h @@ -26,13 +26,13 @@ * This is a Standard C++ Library header. */ +#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS +# include_next +#else #ifndef _GLIBCXX_MATH_H #define _GLIBCXX_MATH_H 1 -#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS -# include_next -#else # include using std::abs; @@ -177,7 +177,5 @@ using std::sph_neumannl; using std::sph_neumann; #endif // __STDCPP_WANT_MATH_SPEC_FUNCS__ -#endif // __cplusplus - #endif // _GLIBCXX_MATH_H - +#endif // __cplusplus diff --git a/libstdc++-v3/include/c_compatibility/stdlib.h b/libstdc++-v3/include/c_compatibility/stdlib.h index 31e7e5f..747ad76 100644 --- a/libstdc++-v3/include/c_compatibility/stdlib.h +++ b/libstdc++-v3/include/c_compatibility/stdlib.h @@ -26,12 +26,13 @@ * This is a Standard C++ Library header. */ -#ifndef _GLIBCXX_STDLIB_H -#define _GLIBCXX_STDLIB_H 1 - #if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS # include_next #else + +#ifndef _GLIBCXX_STDLIB_H +#define _GLIBCXX_STDLIB_H 1 + # include using std::abort; @@ -81,5 +82,5 @@ using std::wctomb; #endif // _GLIBCXX_USE_WCHAR_T #endif -#endif -#endif +#endif // _GLIBCXX_STDLIB_H +#endif // __cplusplus --uAKRQypu60I7Lcqm--