From patchwork Thu Jul 31 19:48:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 2261 Received: (qmail 15698 invoked by alias); 31 Jul 2014 19:49:05 -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 15687 invoked by uid 89); 31 Jul 2014 19:49:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Fri, 1 Aug 2014 01:18:53 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [PATCH] Fix -Wundef warnings in fnmatch.c Message-ID: <20140731194853.GJ16739@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Fixes -Wundef warnings for MBSTATE_T and HAVE_STRING_H. The HAVE_STRING_H bit is a merge from the gnulib fnmatch.c and the MBSTATE_T fix has been posted to gnulib for inclusion. Tested that the code is unchanged on i386. Siddhesh * posix/fnmatch.c: Include string.h unconditionally. [defined _LIBC || WIDE_CHAR_SUPPORT]: Check if _LIBC is defined before checking MBSTATE_T. --- posix/fnmatch.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/posix/fnmatch.c b/posix/fnmatch.c index ca95ab4..8b4d0dc 100644 --- a/posix/fnmatch.c +++ b/posix/fnmatch.c @@ -28,12 +28,7 @@ #include #include #include - -#if HAVE_STRING_H || defined _LIBC -# include -#else -# include -#endif +#include #if defined STDC_HEADERS || defined _LIBC # include @@ -136,7 +131,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags); # define ISWCTYPE(WC, WT) iswctype (WC, WT) # endif -# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC +# if defined _LIBC || (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) /* In this case we are implementing the multibyte character handling. */ # define HANDLE_MULTIBYTE 1 # endif