New module 'mbrtowc'.
[gnulib.git] / m4 / mbrtowc.m4
index a027493..099b748 100644 (file)
@@ -1,9 +1,29 @@
-# mbrtowc.m4 serial 9
+# mbrtowc.m4 serial 10
 dnl Copyright (C) 2001-2002, 2004-2005, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+AC_DEFUN([gl_FUNC_MBRTOWC],
+[
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+  AC_REQUIRE([AC_TYPE_MBSTATE_T])
+  AC_CHECK_FUNCS_ONCE([mbrtowc])
+  if test $ac_cv_func_mbrtowc = no; then
+    HAVE_MBRTOWC=0
+    gl_REPLACE_WCHAR_H
+    AC_LIBOBJ([mbrtowc])
+    gl_PREREQ_MBRTOWC
+  fi
+])
+
+# Prerequisites of lib/mbrtowc.c.
+AC_DEFUN([gl_PREREQ_MBRTOWC], [
+  :
+])
+
+
 dnl From Paul Eggert
 
 dnl This override of an autoconf macro can be removed when autoconf 2.60 or