From: Jim Meyering<address@hidden>
* src/dfa.c (add_utf8_anychar): Always compile this function,
but when MBS_SUPPORT is 0, give it an empty body.
(prepare_wc_buf): Likewise.
---
src/dfa.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/dfa.c b/src/dfa.c
index b6d06aa..ca3c75a 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -1529,10 +1529,10 @@ addtok_wc (wint_t wc)
static void addtok_wc (wint_t wc) {}
#endif
-#if MBS_SUPPORT
static void
add_utf8_anychar (void)
{
+#if MBS_SUPPORT
static const charclass utf8_classes[5] = {
{ 0, 0, 0, 0, ~0, ~0, 0, 0 }, /* 80-bf: non-lead bytes */
{ ~0, ~0, ~0, ~0, 0, 0, 0, 0 }, /* 00-7f: 1-byte sequence
*/
@@ -1577,8 +1577,8 @@ add_utf8_anychar (void)
addtok (CAT);
addtok (OR);
}
-}
#endif
+}
/* The grammar understood by the parser is as follows.
@@ -3146,13 +3146,13 @@ transit_state (struct dfa *d, int s, unsigned char
const **pp)
return s1;
}
-#if MBS_SUPPORT
/* Initialize mblen_buf and inputwcs with data from the next line. */
static void
prepare_wc_buf (const char *begin, const char *end)
{
+#if MBS_SUPPORT
unsigned char eol = eolbyte;
size_t remain_bytes, i;
@@ -3193,9 +3193,8 @@ prepare_wc_buf (const char *begin, const char *end)
buf_end = (unsigned char *) (begin + i);
mblen_buf[i] = 0;
inputwcs[i] = 0; /* sentinel */
-}
-
#endif /* MBS_SUPPORT */
+}
/* Search through a buffer looking for a match to the given struct dfa.
Find the first occurrence of a string matching the regexp in the