bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 27/34] build: enable compilation without MBS_SUPPORT


From: Jim Meyering
Subject: [PATCH 27/34] build: enable compilation without MBS_SUPPORT
Date: Thu, 15 Sep 2011 12:28:10 +0200

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
-- 
1.7.7.rc0.362.g5a14




reply via email to

[Prev in Thread] Current Thread [Next in Thread]