From 7bdfdfca8d8948047946ea3aac8ca5027579f5e6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 19 Dec 2010 14:53:15 +0100 Subject: [PATCH] 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. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FSEEKO. * modules/stdio (Makefile.am): Substitute HAVE_DECL_FSEEKO. * doc/posix-functions/fseeko.texi: Mention the OSF/1 5.1 problem. --- ChangeLog | 9 +++++++++ doc/posix-functions/fseeko.texi | 3 ++- lib/stdio.in.h | 2 +- m4/fseeko.m4 | 7 ++++++- m4/stdio_h.m4 | 3 ++- modules/stdio | 1 + 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f72a000d1..ab330a257 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 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. + * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FSEEKO. + * modules/stdio (Makefile.am): Substitute HAVE_DECL_FSEEKO. + * doc/posix-functions/fseeko.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + fchdir: Add missing declaration on OSF/1 5.1. * lib/unistd.in.h (fchdir): Provide declaration if systems lacks it. * m4/fchdir.m4 (gl_FUNC_FCHDIR): Check whether fchdir is declared. diff --git a/doc/posix-functions/fseeko.texi b/doc/posix-functions/fseeko.texi index 4aea19d67..34095cfea 100644 --- a/doc/posix-functions/fseeko.texi +++ b/doc/posix-functions/fseeko.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{fseeko} 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 fails on seekable stdin, stdout, and stderr: cygwin <= 1.5.24. @end itemize diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 4da4b777d..deca8bf58 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -345,7 +345,7 @@ _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)); # else -# if ! @HAVE_FSEEKO@ +# if ! @HAVE_DECL_FSEEKO@ _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1))); # endif diff --git a/m4/fseeko.m4 b/m4/fseeko.m4 index b97df5337..83b8c84d4 100644 --- a/m4/fseeko.m4 +++ b/m4/fseeko.m4 @@ -1,4 +1,4 @@ -# fseeko.m4 serial 9 +# fseeko.m4 serial 10 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, @@ -10,6 +10,11 @@ AC_DEFUN([gl_FUNC_FSEEKO], AC_REQUIRE([gl_HAVE_FSEEKO]) AC_REQUIRE([gl_STDIN_LARGE_OFFSET]) + AC_CHECK_DECLS_ONCE([fseeko]) + if test $ac_cv_have_decl_fseeko = no; then + HAVE_DECL_FSEEKO=0 + fi + if test $gl_cv_func_fseeko = no; then HAVE_FSEEKO=0 gl_REPLACE_FSEEKO diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index f5650cdea..4d96f8b6e 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 31 +# stdio_h.m4 serial 32 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, @@ -95,6 +95,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) 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_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 f27322eef..0de399bbf 100644 --- a/modules/stdio +++ b/modules/stdio @@ -73,6 +73,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ < $(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_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