From patchwork Wed Mar 23 21:19:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 64278 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp273930lbc; Wed, 23 Mar 2016 14:20:10 -0700 (PDT) X-Received: by 10.66.222.41 with SMTP id qj9mr7355690pac.136.1458768010660; Wed, 23 Mar 2016 14:20:10 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id xg10si6774778pab.141.2016.03.23.14.20.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 14:20:10 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-13398-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of newlib-return-13398-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-13398-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=mB/pA3P3YMKM2+ZXcc0LoO/wtx7vp0bGTPZ/SbJCWdBZGrICV1s4w uIDv7Ax/V4KKIbKVHjy9B1DMjBoRPChPYAnKKN77Z+58WA763lMmn4MRWxdfQCQa bxlau73/LLVk10OVdflexCu93UOUQY2zCCVtnN9SwvAYTZRhyVKxSs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=2bcEEROxy0+ry3MsQvxKS1TkMik=; b=Evbky00n3BRopjZmnrPvAgKv7PFp xrqYDwgP8DP3cabFPamfPFef9Mc4mg1j5FByj9iHTx3vUsPj5z01R3/H5xZQ69QY uctw0Miu8OrbDvaFWJAzPVeedhrSTRXPqvpQbai6Drob3DpM6o8vvLDd2W6QkEGM aEXf8gCKawyGdiA= Received: (qmail 53691 invoked by alias); 23 Mar 2016 21:19:59 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 53676 invoked by uid 89); 23 Mar 2016 21:19:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=C11, distinguish 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; Wed, 23 Mar 2016 21:19:49 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id ECC633B728 for ; Wed, 23 Mar 2016 21:19:47 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-24.rdu2.redhat.com [10.10.116.24]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2NLJk5d015143 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO) for ; Wed, 23 Mar 2016 17:19:47 -0400 From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH] Feature test macros overhaul: C++ TR1 Date: Wed, 23 Mar 2016 16:19:40 -0500 Message-Id: <1458767980-10820-1-git-send-email-yselkowi@redhat.com> While C++11 was the first version of the standard to use C99 functionality, TR1 (for C++03) also does, and G++ does not distinguish between C++98 and C++03, or when TR1 is in use. Therefore, while not strictly correct for "pure" C++98, enabling C99 for all C++ usage is the simplest solution (and much better than always using -D_GNU_SOURCE as on Linux). See thread starting: https://sourceware.org/ml/newlib/2016/msg00297.html Signed-off-by: Yaakov Selkowitz --- newlib/libc/include/sys/features.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.7.0 diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index 1625495..86297de 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -81,7 +81,7 @@ extern "C" { * _XOPEN_SOURCE >= 700 * SUSv4 (POSIX.1-2008 plus XSI) * - * _ISOC99_SOURCE or gcc -std=c99 or g++ -std=c++11 + * _ISOC99_SOURCE or gcc -std=c99 or g++ * ISO C99 * * _ISOC11_SOURCE or gcc -std=c11 or g++ -std=c++11 @@ -204,8 +204,8 @@ extern "C" { * * __ISO_C_VISIBLE >= 1999 * ISO C99; enabled with gcc -std=c99 or newer (on by default since GCC 5), - * g++ -std=c++11 or newer (on by default since GCC 6), or with - * _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L, or _XOPEN_SOURCE >= 600. + * any version of C++, or with _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L, + * or _XOPEN_SOURCE >= 600. * * __ISO_C_VISIBLE >= 2011 * ISO C11; enabled with gcc -std=c11 or newer (on by default since GCC 5), @@ -259,8 +259,8 @@ extern "C" { #if defined(_ISOC11_SOURCE) || \ (__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L #define __ISO_C_VISIBLE 2011 -#elif defined(_ISOC99_SOURCE) || \ - (__STDC_VERSION__ - 0) >= 199901L || (_POSIX_C_SOURCE - 0) >= 200112L +#elif defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200112L || \ + (__STDC_VERSION__ - 0) >= 199901L || defined(__cplusplus) #define __ISO_C_VISIBLE 1999 #else #define __ISO_C_VISIBLE 1990