From patchwork Sun Nov 27 07:04:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 17972 Received: (qmail 23769 invoked by alias); 27 Nov 2016 07:04:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 23690 invoked by uid 89); 27 Nov 2016 07:04:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=losing, exporting, __flags, suites X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH] fnmatch.h: use standard internal defines Date: Sun, 27 Nov 2016 02:04:10 -0500 Message-Id: <20161127070410.6029-1-vapier@gentoo.org> Use features.h for the start/end brackets of C code, and switch to using __USE_GNU/__USE_XOPEN rather than parsing the symbols directly. We also drop support for exporting the GNU-extensions when _POSIX_C_SOURCE is defined to 1 as these aren't in POSIX. 2016-11-27 Mike Frysinger * posix/fnmatch.h: Include features.h. Replace extern "C" with __BEGIN_DECLS and __END_DECLS. Drop _POSIX_C_SOURCE checking. Change _GNU_SOURCE to __USE_GNU. Change _XOPEN_SOURCE to __USE_XOPEN. --- posix/fnmatch.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/posix/fnmatch.h b/posix/fnmatch.h index fdfaf90ba9b9..60a52d4bc755 100644 --- a/posix/fnmatch.h +++ b/posix/fnmatch.h @@ -18,9 +18,9 @@ #ifndef _FNMATCH_H #define _FNMATCH_H 1 -#ifdef __cplusplus -extern "C" { -#endif +#include + +__BEGIN_DECLS /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ @@ -33,7 +33,7 @@ extern "C" { #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ -#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE +#ifdef __USE_GNU # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ @@ -47,7 +47,7 @@ extern "C" { `fnmatch'. Since this is not the case here it will never be returned but the conformance test suites still require the symbol to be defined. */ -#ifdef _XOPEN_SOURCE +#ifdef __USE_XOPEN # define FNM_NOSYS (-1) #endif @@ -55,8 +55,6 @@ extern "C" { returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch (const char *__pattern, const char *__name, int __flags); -#ifdef __cplusplus -} -#endif +__END_DECLS #endif /* fnmatch.h */