diff mbox

Fix -Wundef warnings in fnmatch.c

Message ID 20140731202538.GM16739@spoyarek.pnq.redhat.com
State Committed
Headers show

Commit Message

Siddhesh Poyarekar July 31, 2014, 8:25 p.m. UTC
On Thu, Jul 31, 2014 at 12:57:03PM -0700, Roland McGrath wrote:
> I'd tend toward putting more HAVE_* defines in libc-symbols.h rather than
> having gnulib-shared code test _LIBC.

OK, how about this?

Siddhesh

	* include/libc-symbols.h (HAVE_MBSTATE_T): Define macro.
	(HAVE_MBSRTOWCS): Likewise.
	* posix/fnmatch.c: Include string.h unconditionally.

Comments

Roland McGrath July 31, 2014, 8:28 p.m. UTC | #1
Good
diff mbox

Patch

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 03061ae..d833eb7 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -57,9 +57,11 @@ 
    so it's harmless.  */
 #define HAVE_CONFIG_H	0
 
-/* Define this for the benefit of portable GNU code that wants to check it.
-   Of course, it's never false when building libc!  */
+/* Define these macros for the benefit of portable GNU code that wants to check
+   them.  Of course, STDC_HEADERS is never false when building libc!  */
 #define STDC_HEADERS	1
+#define HAVE_MBSTATE_T	1
+#define HAVE_MBSRTOWCS	1
 
 /* The symbols in all the user (non-_) macros are C symbols.  */
 
diff --git a/posix/fnmatch.c b/posix/fnmatch.c
index ca95ab4..c330a12 100644
--- a/posix/fnmatch.c
+++ b/posix/fnmatch.c
@@ -28,12 +28,7 @@ 
 #include <errno.h>
 #include <fnmatch.h>
 #include <ctype.h>
-
-#if HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
 
 #if defined STDC_HEADERS || defined _LIBC
 # include <stdlib.h>