ftello: Add missing declaration on OSF/1 5.1.
authorBruno Haible <bruno@clisp.org>
Sun, 19 Dec 2010 13:59:22 +0000 (14:59 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 19 Dec 2010 13:59:22 +0000 (14:59 +0100)
* 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.

ChangeLog
doc/posix-functions/ftello.texi
lib/stdio.in.h
m4/ftello.m4
m4/stdio_h.m4
modules/stdio

index ab330a2..1bea88a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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.
        * lib/stdio.in.h (fseeko): Test HAVE_DECL_FSEEKO, not HAVE_FSEEKO.
        * m4/fseeko.m4 (gl_FUNC_FSEEKO): Test whether fseeko is declared.
index 4da2c78..2a33a7f 100644 (file)
@@ -13,7 +13,8 @@ This function is missing on some platforms:
 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:
index deca8bf..6c41d44 100644 (file)
@@ -421,7 +421,7 @@ _GL_CXXALIASWARN (ftell);
 _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));
index 33201a0..21b61a3 100644 (file)
@@ -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 @@ AC_DEFUN([gl_FUNC_FTELLO],
   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(
index 4d96f8b..305ca4e 100644 (file)
@@ -96,6 +96,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   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])
index 0de399b..1a45909 100644 (file)
@@ -74,6 +74,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              < $(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' \