25845f
commit 059bf913b5b3c5553a3756b4d9794e2eb3ce4f25
25845f
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
25845f
Date:   Thu Jun 26 20:40:46 2014 +0530
25845f
25845f
    Fix Wundef warning for WIDE_CHAR_VERSION
25845f
    
25845f
    fnmatch.c defines WIDE_CHAR_VERSION as 1 for wide chars, but does not
25845f
    define it for the non-wide char bits.  Define it and also undef it in
25845f
    fnmatch_loop.c like all other macros.
25845f
25845f
diff --git a/posix/fnmatch.c b/posix/fnmatch.c
25845f
index f0b7b95548c2b9ce..99ec8c4a0eba49b3 100644
25845f
--- a/posix/fnmatch.c
25845f
+++ b/posix/fnmatch.c
25845f
@@ -226,6 +226,7 @@ __wcschrnul (s, c)
25845f
 # define MEMPCPY(D, S, N) __mempcpy (D, S, N)
25845f
 # define MEMCHR(S, C, N) memchr (S, C, N)
25845f
 # define STRCOLL(S1, S2) strcoll (S1, S2)
25845f
+# define WIDE_CHAR_VERSION 0
25845f
 # include "fnmatch_loop.c"
25845f
 
25845f
 
25845f
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
25845f
index 7ffa3a9944630a0c..e289f451cc23c1ee 100644
25845f
--- a/posix/fnmatch_loop.c
25845f
+++ b/posix/fnmatch_loop.c
25845f
@@ -503,7 +503,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			  {
25845f
 			    int32_t table_size;
25845f
 			    const int32_t *symb_table;
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 			    char str[c1];
25845f
 			    unsigned int strcnt;
25845f
 # else
25845f
@@ -515,7 +515,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			    int32_t second;
25845f
 			    int32_t hash;
25845f
 
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 			    /* We have to convert the name to a single-byte
25845f
 			       string.  This is possible since the names
25845f
 			       consist of ASCII characters and the internal
25845f
@@ -570,7 +570,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			      {
25845f
 				/* Compare the byte sequence but only if
25845f
 				   this is not part of a range.  */
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				int32_t *wextra;
25845f
 
25845f
 				idx += 1 + extra[idx];
25845f
@@ -582,7 +582,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 
25845f
 				if (! is_range)
25845f
 				  {
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				    for (c1 = 0;
25845f
 					 (int32_t) c1 < wextra[idx];
25845f
 					 ++c1)
25845f
@@ -603,7 +603,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 
25845f
 				/* Get the collation sequence value.  */
25845f
 				is_seqval = 1;
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				cold = wextra[1 + wextra[idx]];
25845f
 # else
25845f
 				/* Adjust for the alignment.  */
25845f
@@ -666,7 +666,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			uint32_t lcollseq;
25845f
 			UCHAR cend = *p++;
25845f
 
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 			/* Search in the `names' array for the characters.  */
25845f
 			fcollseq = __collseq_table_lookup (collseq, fn);
25845f
 			if (fcollseq == ~((uint32_t) 0))
25845f
@@ -721,7 +721,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			      {
25845f
 				int32_t table_size;
25845f
 				const int32_t *symb_table;
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				char str[c1];
25845f
 				unsigned int strcnt;
25845f
 # else
25845f
@@ -733,7 +733,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 				int32_t second;
25845f
 				int32_t hash;
25845f
 
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				/* We have to convert the name to a single-byte
25845f
 				   string.  This is possible since the names
25845f
 				   consist of ASCII characters and the internal
25845f
@@ -788,7 +788,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 				  {
25845f
 				    /* Compare the byte sequence but only if
25845f
 				       this is not part of a range.  */
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				    int32_t *wextra;
25845f
 
25845f
 				    idx += 1 + extra[idx];
25845f
@@ -799,7 +799,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 # endif
25845f
 				    /* Get the collation sequence value.  */
25845f
 				    is_seqval = 1;
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				    cend = wextra[1 + wextra[idx]];
25845f
 # else
25845f
 				    /* Adjust for the alignment.  */
25845f
@@ -831,7 +831,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			   characters which are not mentioned in the
25845f
 			   collation specification.  */
25845f
 			if (
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 			    lcollseq == 0xffffffff ||
25845f
 # endif
25845f
 			    lcollseq <= fcollseq)
25845f
@@ -843,7 +843,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			      hcollseq = cend;
25845f
 			    else
25845f
 			      {
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 				hcollseq =
25845f
 				  __collseq_table_lookup (collseq, cend);
25845f
 				if (hcollseq == ~((uint32_t) 0))
25845f
@@ -864,7 +864,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
25845f
 			    if (lcollseq <= hcollseq && fcollseq <= hcollseq)
25845f
 			      goto matched;
25845f
 			  }
25845f
-# ifdef WIDE_CHAR_VERSION
25845f
+# if WIDE_CHAR_VERSION
25845f
 		      range_not_matched:
25845f
 # endif
25845f
 #else
25845f
@@ -1279,3 +1279,4 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
25845f
 #undef STRCAT
25845f
 #undef L
25845f
 #undef BTOWC
25845f
+#undef WIDE_CHAR_VERSION