[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gettext: mbrtowc & !mbsinit
From: |
Golubev I. N. |
Subject: |
gettext: mbrtowc & !mbsinit |
Date: |
Mon, 18 Jun 2001 08:50:35 (GMT) |
Version: 0.10.38
System: i586-pc-sco3.2v5.0.2
Some buggy libc's have mbrtowc, but not mbsinit (violate Amendment 1
of ISO C90?). It appears that this is because mbstate_t value is
never used by mbrtowc (mbstate_t is char, just to shut compiler), so I
pretend that mbsinit always returns true.
--- lib/mbswidth.c 2001/06/17 10:03:24 1.1
+++ lib/mbswidth.c 2001/06/17 10:18:33 1.2
@@ -188,6 +188,9 @@
p += bytes;
}
+#ifndef HAVE_MBSINIT
+#define mbsinit(x) 1
+#endif /* ndef HAVE_MBSINIT */
while (! mbsinit (&mbstate));
}
break;
--- m4/mbswidth.m4 2001/06/17 10:10:01 1.1
+++ m4/mbswidth.m4 2001/06/17 10:18:33 1.2
@@ -9,6 +9,9 @@
AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
AC_CHECK_FUNCS(isascii iswcntrl iswprint wcwidth)
jm_FUNC_MBRTOWC
+ if test yes = $jm_cv_func_mbrtowc; then
+ AC_CHECK_FUNCS(mbsinit)
+ fi
AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
[AC_TRY_COMPILE([
- gettext: mbrtowc & !mbsinit,
Golubev I. N. <=