mbsinit.m4 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # mbsinit.m4 serial 9
  2. dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. AC_DEFUN([gl_FUNC_MBSINIT],
  7. [
  8. AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
  9. AC_REQUIRE([AC_CANONICAL_HOST])
  10. AC_REQUIRE([AC_TYPE_MBSTATE_T])
  11. gl_MBSTATE_T_BROKEN
  12. AC_CHECK_FUNCS_ONCE([mbsinit])
  13. if test $ac_cv_func_mbsinit = no; then
  14. HAVE_MBSINIT=0
  15. AC_CHECK_DECLS([mbsinit],,, [[
  16. #include <wchar.h>
  17. ]])
  18. if test $ac_cv_have_decl_mbsinit = yes; then
  19. dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
  20. dnl it does not have the function. Avoid a collision with gnulib's
  21. dnl replacement.
  22. REPLACE_MBSINIT=1
  23. fi
  24. else
  25. if test $REPLACE_MBSTATE_T = 1; then
  26. REPLACE_MBSINIT=1
  27. else
  28. dnl On mingw, mbsinit() always returns 1, which is inappropriate for
  29. dnl states produced by mbrtowc() for an incomplete multibyte character
  30. dnl in multibyte locales.
  31. case "$host_os" in
  32. mingw*) REPLACE_MBSINIT=1 ;;
  33. esac
  34. fi
  35. fi
  36. ])
  37. # Prerequisites of lib/mbsinit.c.
  38. AC_DEFUN([gl_PREREQ_MBSINIT], [
  39. :
  40. ])