bug-gnulib
[Top][All Lists]
Advanced

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

Re: mbrtowc.m4 on mingw32


From: Stepan Kasal
Subject: Re: mbrtowc.m4 on mingw32
Date: Mon, 4 Jul 2005 13:29:04 +0200
User-agent: Mutt/1.4.1i

Hello Bruno,

On Mon, Jul 04, 2005 at 01:18:25PM +0200, Bruno Haible wrote:
> On mingw32, mbrtowc.m4 "detects" that mbrtowc() exists, leading to
> link errors. Actually, mbrtowc() does not exist on this system,
> it's only declared in <wchar.h> but not actually implemented under
> this name.

why cannot we use the Autoconf macro AC_FUNC_MBRTOWC?

(I mean with current Autoconf.  If there is a need to support some
older versions of Autoconf, we could perhaps copy the definition of
the macro to gnulib's mbrtowc.m4.)

A copy of the macro is attached below; does it work for you?

Have a nice day,
        Stepan

# AC_FUNC_MBRTOWC
# ---------------
AN_FUNCTION([mbrtowc], [AC_FUNC_MBRTOWC])
AC_DEFUN([AC_FUNC_MBRTOWC],
[
  AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
    ac_cv_func_mbrtowc,
    [AC_LINK_IFELSE(
       [AC_LANG_PROGRAM(
            address@hidden:@include <wchar.h>]],
            [[wchar_t wc;
              char const s[] = "";
              size_t n = 1;
              mbstate_t state;
              return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
       ac_cv_func_mbrtowc=yes,
       ac_cv_func_mbrtowc=no)])
  if test $ac_cv_func_mbrtowc = yes; then
    AC_DEFINE([HAVE_MBRTOWC], 1,
      [Define to 1 if mbrtowc and mbstate_t are properly declared.])
  fi
])





reply via email to

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