summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-30 16:05:33 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-30 16:05:33 +0000
commit75b1747bb2343695a736cfbb361d40026d4edeac (patch)
tree74287311ad8994aa200f858718f7ec4e48300103 /libc/misc
parentbda2d7e868b4fe7c098484aea1d0105a55b75fcf (diff)
make regex a little bit smaller
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/regex/regex.c3
-rw-r--r--libc/misc/regex/regex_internal.c4
-rw-r--r--libc/misc/regex/regex_internal.h3
3 files changed, 7 insertions, 3 deletions
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index 3e53a2ea6..77c09a011 100644
--- a/libc/misc/regex/regex.c
+++ b/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>
diff --git a/libc/misc/regex/regex_internal.c b/libc/misc/regex/regex_internal.c
index 6299f547e..3fc62d731 100644
--- a/libc/misc/regex/regex_internal.c
+++ b/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
diff --git a/libc/misc/regex/regex_internal.h b/libc/misc/regex/regex_internal.h
index 4782883c1..d82cf6d42 100644
--- a/libc/misc/regex/regex_internal.h
+++ b/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