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 ab330a2573a5ac40731053367e5815490fb2d742..1bea88a5230eeb1e142d4ea70d0b19a2da97e475 100644 (file)
--- 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.
index 4da2c7836d1f9c63fdbb74fc51bb9456fbfe8d40..2a33a7f0c1ce1fba4d9a055bda96aa6c4e34fcba 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 deca8bf5827e2842e2aa246cb0d8893464f68095..6c41d441090a8b9a40aef3d04606c12bd9222bef 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 33201a0107c97112d74df42abab668c00ca203ed..21b61a3072242fbb004994d3d40cbbb80ac5e024 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 4d96f8b6e5b4b35f579ec22a96dbb531cb37d965..305ca4eedb4d7f500e57815e68086fc4999249a0 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 0de399bbf037176d532eba695612a184a4623fec..1a45909f22db4c7152e3f16c89ef771de5643303 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' \