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