From eedb2b7b21f577d9b1ce0fbd2bbe3467a2ff165f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 19 Dec 2010 14:59:22 +0100 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ doc/posix-functions/ftello.texi | 3 ++- lib/stdio.in.h | 2 +- m4/ftello.m4 | 7 ++++++- m4/stdio_h.m4 | 1 + modules/stdio | 1 + 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab330a257..1bea88a52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-12-19 Bruno Haible + 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 + 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. diff --git a/doc/posix-functions/ftello.texi b/doc/posix-functions/ftello.texi index 4da2c7836..2a33a7f0c 100644 --- a/doc/posix-functions/ftello.texi +++ b/doc/posix-functions/ftello.texi @@ -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{} 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: diff --git a/lib/stdio.in.h b/lib/stdio.in.h index deca8bf58..6c41d4410 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -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)); diff --git a/m4/ftello.m4 b/m4/ftello.m4 index 33201a010..21b61a307 100644 --- 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 @@ AC_DEFUN([gl_FUNC_FTELLO], dnl Persuade glibc 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( diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index 4d96f8b6e..305ca4eed 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -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]) diff --git a/modules/stdio b/modules/stdio index 0de399bbf..1a45909f2 100644 --- a/modules/stdio +++ b/modules/stdio @@ -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' \ -- 2.11.0