From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@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 20:00:00 -0000 Message-Id: <20170613200022.5056-1-yselkowi@redhat.com> X-SW-Source: 2017/txt/msg00410.txt.bz2 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(+) 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 */ -- 2.12.3