]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/configure.in
configure.in: Check whether mbstowcs works.
[gcc.git] / gcc / configure.in
index 2589c13c0dae564962bb029e6d087430be6bf2f5..fefc7a1555e46fbbda926e806c0408c9c18521c6 100644 (file)
@@ -789,6 +789,24 @@ AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
        fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
         scandir alphasort gettimeofday mbstowcs wcswidth)
 
+if test x$ac_cv_func_mbstowcs = xyes; then
+  AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
+[    AC_TRY_RUN([#include <stdlib.h>
+int main()
+{
+  mbstowcs(0, "", 0);
+  return 0;
+}],
+    gcc_cv_func_mbstowcs_works=yes,
+    gcc_cv_func_mbstowcs_works=no,
+    gcc_cv_func_mbstowcs_works=yes)])
+  if test x$gcc_cv_func_mbstowcs_works = xyes; then
+    AC_DEFINE(HAVE_WORKING_MBSTOWCS, 1,
+  [Define this macro if mbstowcs does not crash when its
+   first argument is NULL.])
+  fi
+fi
+
 AC_CHECK_TYPE(ssize_t, int)
 
 # Try to determine the array type of the second argument of getgroups
This page took 0.028319 seconds and 5 git commands to generate.