Fix -Wundef warnings in fnmatch.c
Commit Message
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
@@ -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. */
@@ -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>