From patchwork Tue Jun 13 20:00:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 105413 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp579088qgd; Tue, 13 Jun 2017 13:01:15 -0700 (PDT) X-Received: by 10.84.136.129 with SMTP id 1mr1339216pll.213.1497384075744; Tue, 13 Jun 2017 13:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497384075; cv=none; d=google.com; s=arc-20160816; b=o8ZTYxDBI1DOe9Cw2JNafsHIGfjledelEmZs71GiW55/XKjLDW2rQsfCCR3CAS6qHf Qeql5JUJHoYSY5VhvCTk3buDF2BIxxd1i92yN60nn8azzMhg+SYWR8chOU+86i+/xZPZ 6Vnc667BXKgob4res4H7ivagB9Urijd6+f1zqPoHTrfIZSLVOejZ1DPDism1m+p6ABHK IBSAKZrYwweBjaBXGp+AdwM33Cww9mG3Gb+/Zlm2LbFf5jXnKR0D0whvez4aMHbi3t2g +FGVglDyfleSPm6pdFCiLgXSEeUuC3tO1n3HVU6M0vRObj9M6F6nc5yLCS+1zHPRBnKo H17Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-filter:dmarc-filter :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=cXMSqvXGmdRf01KfSt7qn+CsMrOZIAIITjDpEKwJ76c=; b=vrwJiBnuh4PragNEcXsFUShctcFh8ZS4pycsJAd5a6wa60rQow02tqEW5WkskszgqM oBRWp4ZgQUWRhcq6uARmlCGbbCKHB/jcRUzQRY9mG93W77ofae4D9gGxtUK2I6f1jA2D ljbd71c+bAUVsZHYSHMle2lxXQn42xx/wSUtXjIa436xR+039mQ5EfvtUfe+q7YBH8Mj vM09FdPPCvKjTegrMMKgJ0pjpDras97mS2FCV1Miv/1pi0yRtRW6lmy4ZPcE/K30vl5E OzUFK960aonGvDcYviVaHhm1q1zIaFCO8+895XJtphgHNpOHqDlR1DGmzYRv3wOgBxWs VwSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of newlib-return-14648-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-14648-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b65si689384pfj.228.2017.06.13.13.01.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 13:01:15 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-14648-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-14648-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-14648-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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=BmaFAIi5ltoBQVowh2+I5PDRswx0xDupWQIDbCrF8Thgcd/Q9qeK6 3OWzc/WM8jLgXj49XU8Q9KQpNbtyChnpZDEQv3eGVotERlYIreJHW/WtJN+X3AqG +rGWpreswoXkT2CrZkY+YVqZgbPKMAV1pW7VOMR4F+Q07YkrEVUqE0= 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=w7hTXjRhYLSlCx8f0gEcBJEY2Ig=; b=LSrAJUlxVv5BgpGvMcv0VNya2n7b yQ/nP0OYc7oOwaIoNHPbYwY2YbX+aNIeSx6fGlp1XqYgI5/AMArdFml85BF/jNPY +YvacMpAbtRc3i31bBKMZgdUzl48mYmMSRwNELfhXMvXuwRV3KfndJo48Y3jw6rN 8BInfyXeLVcAPa8= Received: (qmail 53228 invoked by alias); 13 Jun 2017 20:00:43 -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 51228 invoked by uid 89); 13 Jun 2017 20:00:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*MI:5056 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 ESMTP; Tue, 13 Jun 2017 20:00:35 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FB4880F9F for ; Tue, 13 Jun 2017 20:00:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9FB4880F9F Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=yselkowi@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9FB4880F9F Received: from localhost.localdomain (ovpn-120-23.rdu2.redhat.com [10.10.120.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40AAA60E3E for ; Tue, 13 Jun 2017 20:00:38 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH] stdio.h: guard function macros with !__cplusplus Date: Tue, 13 Jun 2017 15:00:21 -0500 Message-Id: <20170613200022.5056-1-yselkowi@redhat.com> While POSIX allows these functions to also be defined as macros in C, in C++ this is not allowed, and prevents these names (particularly feof) from being used in a custom namespace. Signed-off-by: Yaakov Selkowitz --- newlib/libc/include/stdio.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.12.3 diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 097b0f665..1c32423d3 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -718,6 +718,7 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) { #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) #define __sfileno(p) ((p)->_file) +#ifndef __cplusplus #ifndef _REENT_SMALL #define feof(p) __sfeof(p) #define ferror(p) __sferror(p) @@ -740,6 +741,7 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) { #define putc(x, fp) __sputc_r(_REENT, x, fp) #endif /* lint */ #endif /* __CYGWIN__ */ +#endif /* __cplusplus */ #if __MISC_VISIBLE /* fast always-buffered version, true iff error */