# HG changeset patch # User Eric Blake # Date 1383917623 25200 # Node ID 71cf3cc49683748269e90d006aa0ad034ef6e230 # Parent c93b873f03902433e5c23a5c4b6a45f0865b96a2 fpending: fix regression on DragonFly BSD Commit 3f5bf99e claimed that it is safe to declare __fpending twice, but in reality this caused a regression on Dragonfly BSD. Reported by GW in , . * m4/fpending.m4 (gl_FUNC_FPENDING): Check for declaration. * lib/fpending.h (__fpending): Don't declare twice. Signed-off-by: Eric Blake diff -r c93b873f0390 -r 71cf3cc49683 ChangeLog --- a/ChangeLog Tue Nov 05 08:27:10 2013 -0800 +++ b/ChangeLog Fri Nov 08 06:33:43 2013 -0700 @@ -1,3 +1,11 @@ +2013-11-08 Eric Blake + + fpending: fix regression on DragonFly BSD + * m4/fpending.m4 (gl_FUNC_FPENDING): Check for declaration. + * lib/fpending.h (__fpending): Don't declare twice. + Reported by GW in + + 2013-11-05 Jim Meyering hash: relax license to LGPLv2+, for libguestfs diff -r c93b873f0390 -r 71cf3cc49683 lib/fpending.h --- a/lib/fpending.h Tue Nov 05 08:27:10 2013 -0800 +++ b/lib/fpending.h Fri Nov 08 06:33:43 2013 -0700 @@ -24,6 +24,6 @@ # include #endif -#ifndef __fpending +#if !HAVE_DECL_FPENDING size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE; #endif diff -r c93b873f0390 -r 71cf3cc49683 m4/fpending.m4 --- a/m4/fpending.m4 Tue Nov 05 08:27:10 2013 -0800 +++ b/m4/fpending.m4 Fri Nov 08 06:33:43 2013 -0700 @@ -1,4 +1,4 @@ -# serial 20 +# serial 21 # Copyright (C) 2000-2001, 2004-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -16,19 +16,23 @@ AC_DEFUN([gl_FUNC_FPENDING], [ AC_CHECK_HEADERS_ONCE([stdio_ext.h]) + fp_headers=' + #include + #if HAVE_STDIO_EXT_H + # include + #endif + ' AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending], [ AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #if HAVE_STDIO_EXT_H - # include - #endif - ]], + [AC_LANG_PROGRAM([$fp_headers], [[return ! __fpending (stdin);]])], [gl_cv_func___fpending=yes], [gl_cv_func___fpending=no]) ]) + if test $gl_cv_func___fpending = yes; then + AC_CHECK_DECLS([__fpending], [], [], [$fp_headers]) + fi ]) AC_DEFUN([gl_PREREQ_FPENDING],