Browse Source

make regex a little bit smaller

Peter S. Mazinger 18 years ago
parent
commit
75b1747bb2
3 changed files with 7 additions and 3 deletions
  1. 3 0
      libc/misc/regex/regex.c
  2. 2 2
      libc/misc/regex/regex_internal.c
  3. 2 1
      libc/misc/regex/regex_internal.h

+ 3 - 0
libc/misc/regex/regex.c

@@ -28,6 +28,9 @@
 #ifdef __UCLIBC__
 #undef _LIBC
 #define _REGEX_RE_COMP
+#define HAVE_MEMPCPY
+#define HAVE_LANGINFO
+#define HAVE_LANGINFO_CODESET
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>

+ 2 - 2
libc/misc/regex/regex_internal.c

@@ -195,7 +195,7 @@ static void
 internal_function
 build_wcs_buffer (re_string_t *pstr)
 {
-#ifdef _LIBC
+#if defined _LIBC || defined __UCLIBC__
   unsigned char buf[MB_LEN_MAX];
   assert (MB_LEN_MAX >= pstr->mb_cur_max);
 #else
@@ -266,7 +266,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
   mbstate_t prev_st;
   int src_idx, byte_idx, end_idx, remain_len;
   size_t mbclen;
-#ifdef _LIBC
+#if defined _LIBC || defined __UCLIBC__
   char buf[MB_LEN_MAX];
   assert (MB_LEN_MAX >= pstr->mb_cur_max);
 #else

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

@@ -29,6 +29,7 @@
 
 #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
 # include <langinfo.h>
+libc_hidden_proto(nl_langinfo)
 #endif
 #if defined HAVE_LOCALE_H || defined _LIBC
 # include <locale.h>
@@ -52,7 +53,7 @@
 #endif
 
 /* In case that the system doesn't have isblank().  */
-#if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank
+#if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank && !defined __UCLIBC__
 # define isblank(ch) ((ch) == ' ' || (ch) == '\t')
 #endif