From cceacad1d367b3019a5648521d4b4c0e201297f5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 14 Nov 2011 21:43:44 +0200 Subject: More changes for non-MBS case. --- ChangeLog | 8 ++++++++ mbsupport.h | 6 ++++-- missing_d/ChangeLog | 4 ++++ missing_d/wcmisc.c | 14 +++++++++++++- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b440a95..b8397f5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-11-14 Arnold D. Robbins + + * mbsupport.h: Add check for HAVE_BTOWC, per Pat Rankin. + +2011-11-12 Eli Zaretskii + + * mbsupport.h: Additional glop for dfa.c in Windows environment. + 2011-11-01 Arnold D. Robbins * dfa.c: Move glop for ! MBS_SUPPORT to ... diff --git a/mbsupport.h b/mbsupport.h index 1a30785d..57abaa60 100644 --- a/mbsupport.h +++ b/mbsupport.h @@ -40,6 +40,7 @@ #if defined(HAVE_ISWCTYPE) \ && defined(HAVE_LOCALE_H) \ + && defined(HAVE_BTOWC) \ && defined(HAVE_MBRLEN) \ && defined(HAVE_MBRTOWC) \ && defined(HAVE_WCHAR_H) \ @@ -70,10 +71,11 @@ /* All this glop is for dfa.c. Bleah. */ +#define wchar_t char #define wctype_t int -#define wint_t int +#define wint_t int #define mbstate_t int -#define WEOF EOF +#define WEOF EOF #define towupper toupper #define towlower tolower #define btowc(x) (x) diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog index 45cc1acc..4a06aa60 100644 --- a/missing_d/ChangeLog +++ b/missing_d/ChangeLog @@ -1,3 +1,7 @@ +2011-11-02 Pat Rankin + + * wcmisc.c: Make code be conditional upon corresponding !HAVE_WCxxx. + 2011-11-01 Arnold D. Robbins * wcmisc.c: New file. diff --git a/missing_d/wcmisc.c b/missing_d/wcmisc.c index e53730ea..d2b7aa08 100644 --- a/missing_d/wcmisc.c +++ b/missing_d/wcmisc.c @@ -16,8 +16,9 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA */ +#if !defined(HAVE_WCTYPE) || !defined(HAVE_ISWCTYPE) static const char *classes[] = { - "", + "", "alnum", "alpha", "blank", @@ -32,12 +33,16 @@ static const char *classes[] = { "xdigit", NULL }; +#endif +#ifndef HAVE_ISWCTYPE static int is_blank (int c) { return (c == ' ' || c == '\t'); } +#endif +#ifndef HAVE_WCTYPE wctype_t wctype(const char *name) { int i; @@ -48,7 +53,9 @@ wctype_t wctype(const char *name) return 0; } +#endif +#ifndef HAVE_ISWCTYPE int iswctype(wint_t wc, wctype_t desc) { int j = sizeof(classes) / sizeof(classes[0]); @@ -72,7 +79,9 @@ int iswctype(wint_t wc, wctype_t desc) default: return 0; } } +#endif +#ifndef HAVE_WCSCOLL int wcscoll(const wchar_t *ws1, const wchar_t *ws2) { size_t i; @@ -86,3 +95,6 @@ int wcscoll(const wchar_t *ws1, const wchar_t *ws2) return (ws1[i] - ws2[i]); } +#endif + +/*wcmisc.c*/ -- cgit v1.2.3