changeset 13943:190accfb0919

ftello: Add missing declaration on OSF/1 5.1. * lib/stdio.in.h (ftello): Test HAVE_DECL_FTELLO, not HAVE_FTELLO. * m4/ftello.m4 (gl_FUNC_FTELLO): Test whether ftello is declared. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FTELLO. * modules/stdio (Makefile.am): Substitute HAVE_DECL_FTELLO. * doc/posix-functions/ftello.texi: Mention the OSF/1 5.1 problem.
author Bruno Haible <bruno@clisp.org>
date Sun, 19 Dec 2010 14:59:22 +0100
parents 525c4e92ae7e
children b0e21b9566f9
files ChangeLog doc/posix-functions/ftello.texi lib/stdio.in.h m4/ftello.m4 m4/stdio_h.m4 modules/stdio
diffstat 6 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-19  Bruno Haible  <bruno@clisp.org>
+
+	ftello: Add missing declaration on OSF/1 5.1.
+	* lib/stdio.in.h (ftello): Test HAVE_DECL_FTELLO, not HAVE_FTELLO.
+	* m4/ftello.m4 (gl_FUNC_FTELLO): Test whether ftello is declared.
+	* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FTELLO.
+	* modules/stdio (Makefile.am): Substitute HAVE_DECL_FTELLO.
+	* doc/posix-functions/ftello.texi: Mention the OSF/1 5.1 problem.
+
 2010-12-19  Bruno Haible  <bruno@clisp.org>
 
 	fseeko: Add missing declaration on OSF/1 5.1.
--- a/doc/posix-functions/ftello.texi
+++ b/doc/posix-functions/ftello.texi
@@ -13,7 +13,8 @@
 IRIX 5.3, OSF/1 4.0, Solaris 2.5.1, mingw.
 @item
 The declaration of @code{ftello} in @code{<stdio.h>} is not enabled by default
-on some platforms: glibc 2.3.6.
+on some platforms:
+glibc 2.3.6, OSF/1 5.1.
 @item
 This function produces incorrect results after @code{putc} that followed a
 @code{getc} call that reached EOF on some platforms:
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -421,7 +421,7 @@
 _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
 # else
-#  if ! @HAVE_FTELLO@
+#  if ! @HAVE_DECL_FTELLO@
 _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
 #  endif
 _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
--- a/m4/ftello.m4
+++ b/m4/ftello.m4
@@ -1,4 +1,4 @@
-# ftello.m4 serial 8
+# ftello.m4 serial 9
 dnl Copyright (C) 2007-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,
@@ -13,6 +13,11 @@
   dnl Persuade glibc <stdio.h> to declare ftello().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
+  AC_CHECK_DECLS_ONCE([ftello])
+  if test $ac_cv_have_decl_ftello = no; then
+    HAVE_DECL_FTELLO=0
+  fi
+
   AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
     [
       AC_LINK_IFELSE(
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -96,6 +96,7 @@
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_FPURGE=1;            AC_SUBST([HAVE_DECL_FPURGE])
   HAVE_DECL_FSEEKO=1;            AC_SUBST([HAVE_DECL_FSEEKO])
+  HAVE_DECL_FTELLO=1;            AC_SUBST([HAVE_DECL_FTELLO])
   HAVE_DECL_GETDELIM=1;          AC_SUBST([HAVE_DECL_GETDELIM])
   HAVE_DECL_GETLINE=1;           AC_SUBST([HAVE_DECL_GETLINE])
   HAVE_DECL_OBSTACK_PRINTF=1;    AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
--- a/modules/stdio
+++ b/modules/stdio
@@ -74,6 +74,7 @@
 	      < $(srcdir)/stdio.in.h | \
 	  sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
 	      -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+	      -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
 	      -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
 	      -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
 	      -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \