4
0

mbrtowc.m4 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. # mbrtowc.m4 serial 8
  2. dnl Copyright (C) 2001-2002, 2004-2005 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. dnl From Paul Eggert
  7. dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with
  8. dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere.
  9. AC_DEFUN([gl_FUNC_MBRTOWC],
  10. [
  11. dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
  12. AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
  13. gl_cv_func_mbrtowc,
  14. [AC_LINK_IFELSE(
  15. [AC_LANG_PROGRAM(
  16. [[#include <wchar.h>]],
  17. [[wchar_t wc;
  18. char const s[] = "";
  19. size_t n = 1;
  20. mbstate_t state;
  21. return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
  22. gl_cv_func_mbrtowc=yes,
  23. gl_cv_func_mbrtowc=no)])
  24. if test $gl_cv_func_mbrtowc = yes; then
  25. AC_DEFINE([HAVE_MBRTOWC], 1,
  26. [Define to 1 if mbrtowc and mbstate_t are properly declared.])
  27. fi
  28. ])