]> git.cworth.org Git - tar/blobdiff - m4/btowc.m4
Imported Upstream version 1.23
[tar] / m4 / btowc.m4
index 64ff82906155bcfbf1cfdaaa4258c3221bbcebfa..2c75c8fb02a6e8794a140f44f4ce49d86028e4df 100644 (file)
@@ -1,5 +1,5 @@
-# btowc.m4 serial 3
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# btowc.m4 serial 5
+dnl Copyright (C) 2008-2010 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.
@@ -8,6 +8,11 @@ AC_DEFUN([gl_FUNC_BTOWC],
 [
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
 
+  dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
+  dnl program below may lead to an endless loop. See
+  dnl <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
+  AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+
   AC_CHECK_FUNCS_ONCE([btowc])
   if test $ac_cv_func_btowc = no; then
     HAVE_BTOWC=0
@@ -47,7 +52,7 @@ int main ()
 }],
             [gl_cv_func_btowc_eof=yes],
             [gl_cv_func_btowc_eof=no],
-            [])
+            [:])
         fi
       ])
     case "$gl_cv_func_btowc_eof" in