summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-04-05 18:24:18 +0000
committerJim Meyering <jim@meyering.net>1998-04-05 18:24:18 +0000
commitf711379c33b61c8258767154bebed5be41355a8e (patch)
tree7eb4dc7de05e638702089458f72b31d614fc96d0
parentf37e1ba81c0bab8122648cf9b3304fea5a38adc4 (diff)
downloadgnulib-f711379c33b61c8258767154bebed5be41355a8e.tar.gz
(WIDE_CHAR_SUPPORT): Define.
This now depends on HAVE_BTOWC so systems that lack btowc (like solaris-2.5.1) don't lose.
-rw-r--r--lib/regex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/regex.c b/lib/regex.c
index 74eaa2dcc9..d16bd60381 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -49,9 +49,12 @@
# include <sys/types.h>
#endif
+#define WIDE_CHAR_SUPPORT \
+ defined _LIBC || (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
+
/* For platform which support the ISO C amendement 1 functionality we
support user defined character classes. */
-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+#if WIDE_CHAR_SUPPORT
# include <wchar.h>
# include <wctype.h>
#endif
@@ -1685,7 +1688,7 @@ typedef struct
} \
}
-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+#if WIDE_CHAR_SUPPORT
/* The GNU C library provides support for user-defined character classes
and the functions from ISO C amendement 1. */
# ifdef CHARCLASS_NAME_MAX
@@ -2185,7 +2188,7 @@ regex_compile (pattern, size, syntax, bufp)
the leading `:' and `[' (but set bits for them). */
if (c == ':' && *p == ']')
{
-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+#if WIDE_CHAR_SUPPORT
boolean is_lower = STREQ (str, "lower");
boolean is_upper = STREQ (str, "upper");
wctype_t wt;