# HG changeset patch # User Bruno Haible # Date 1292767162 -3600 # Node ID 190accfb09197adbb23eac7afffc009bea32e56e # Parent 525c4e92ae7e2fcbc0f3e2aef3d94a9a3bd41250 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. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +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. diff --git a/doc/posix-functions/ftello.texi b/doc/posix-functions/ftello.texi --- 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{} 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 --- 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)); diff --git a/m4/ftello.m4 b/m4/ftello.m4 --- 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 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 --- 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]) diff --git a/modules/stdio b/modules/stdio --- 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' \