Browse Source

Make new regex build w/ WCHAR disabled, vapier, does it now work for you?

Peter S. Mazinger 18 years ago
parent
commit
e5b07a0aed
2 changed files with 6 additions and 0 deletions
  1. 4 0
      libc/misc/regex/regcomp.c
  2. 2 0
      libc/misc/regex/regex_internal.h

+ 4 - 0
libc/misc/regex/regcomp.c

@@ -833,7 +833,11 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
   dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
   dfa->state_hash_mask = table_size - 1;
 
+#ifdef __UCLIBC_HAS_WCHAR__
   dfa->mb_cur_max = MB_CUR_MAX;
+#else
+  dfa->mb_cur_max = 1;
+#endif
 #ifdef _LIBC
   if (dfa->mb_cur_max == 6
       && strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0)

+ 2 - 0
libc/misc/regex/regex_internal.h

@@ -670,7 +670,9 @@ typedef struct
   {
     unsigned char ch;
     unsigned char *name;
+#ifdef __UCLIBC_HAS_WCHAR__
     wchar_t wch;
+#endif
   } opr;
 } bracket_elem_t;