bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gettext: mbrtowc & !mbsinit


From: Bruno Haible
Subject: Re: gettext: mbrtowc & !mbsinit
Date: Mon, 25 Jun 2001 19:58:25 +0200 (CEST)

Golubev I. N. writes:
> 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.

Thanks for the report and patch. I'll use a patch very similar to
yours.

Bruno

Index: m4/mbswidth.m4
===================================================================
RCS file: /cvs/gettext/gettext/m4/mbswidth.m4,v
retrieving revision 1.4
diff -c -3 -r1.4 mbswidth.m4
*** mbswidth.m4 2001/04/17 19:49:56     1.4
--- mbswidth.m4 2001/06/25 18:02:22
***************
*** 1,4 ****
! #serial 4
  
  dnl autoconf tests required for use of mbswidth.c
  dnl From Bruno Haible.
--- 1,4 ----
! #serial 5
  
  dnl autoconf tests required for use of mbswidth.c
  dnl From Bruno Haible.
***************
*** 7,13 ****
  [
    AC_REQUIRE([AC_HEADER_STDC])
    AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
!   AC_CHECK_FUNCS(isascii iswcntrl iswprint wcwidth)
    jm_FUNC_MBRTOWC
  
    AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
--- 7,13 ----
  [
    AC_REQUIRE([AC_HEADER_STDC])
    AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
!   AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
    jm_FUNC_MBRTOWC
  
    AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
Index: lib/mbswidth.c
===================================================================
RCS file: /cvs/gettext/gettext/lib/mbswidth.c,v
retrieving revision 1.2
diff -c -3 -r1.2 mbswidth.c
*** mbswidth.c  2001/04/17 19:33:35     1.2
--- mbswidth.c  2001/06/25 18:02:22
***************
*** 43,48 ****
--- 43,54 ----
  #endif
  #if !defined iswcntrl && !HAVE_ISWCNTRL
  # define iswcntrl(wc) 0
+ #endif
+ 
+ #ifndef mbsinit
+ # if !HAVE_MBSINIT
+ #  define mbsinit(ps) 1
+ # endif
  #endif
  
  #ifndef HAVE_DECL_WCWIDTH



reply via email to

[Prev in Thread] Current Thread [Next in Thread]