From 28b78430edd4230b709985803d942c98614caa9b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 13 Jun 2011 17:33:59 +0200 Subject: [PATCH] ftello: Provide a non-inline replacement of ftell(). * lib/stdio.in.h (ftell): Don't provide if module 'ftell' is not used. * m4/ftell.m4 (gl_FUNC_FTELL): Replace ftell also if the system does not have ftello() (such as on mingw). * modules/ftello (Depends-on): Add ftell. * modules/ftell (License): Change to LGPLv2+. --- ChangeLog | 9 +++++++++ lib/stdio.in.h | 19 ------------------- m4/ftell.m4 | 4 ++-- modules/ftell | 2 +- modules/ftello | 2 ++ 5 files changed, 14 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6037c0c87..d89b38708 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-06-13 Bruno Haible + + ftello: Provide a non-inline replacement of ftell(). + * lib/stdio.in.h (ftell): Don't provide if module 'ftell' is not used. + * m4/ftell.m4 (gl_FUNC_FTELL): Replace ftell also if the system does + not have ftello() (such as on mingw). + * modules/ftello (Depends-on): Add ftell. + * modules/ftell (License): Change to LGPLv2+. + 2011-05-07 Bruno Haible ftell: Move AC_LIBOBJ invocations to module description. diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 1ad8943fe..fee5b65cf 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -539,25 +539,6 @@ _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp)); # endif _GL_CXXALIASWARN (ftello); -# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@ - /* Provide an ftell function that is consistent with ftello. */ - /* In order to avoid that ftell gets defined as a macro here, the - developer can request the 'ftell' module. */ -# if !GNULIB_defined_ftell_function -# undef ftell -# define ftell rpl_ftell -static inline long _GL_ARG_NONNULL ((1)) -rpl_ftell (FILE *f) -{ -# if @REPLACE_FTELLO@ - return rpl_ftello (f); -# else - return ftello (f); -# endif -} -# define GNULIB_defined_ftell_function 1 -# endif -# endif #elif defined GNULIB_POSIXCHECK # define _GL_FTELL_WARN /* Category 1, above. */ # undef ftell diff --git a/m4/ftell.m4 b/m4/ftell.m4 index 00d7bbec9..c529c5030 100644 --- a/m4/ftell.m4 +++ b/m4/ftell.m4 @@ -1,4 +1,4 @@ -# ftell.m4 serial 2 +# ftell.m4 serial 3 dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_FTELL], AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_FTELLO]) dnl When ftello needs fixes, ftell needs them too. - if test $REPLACE_FTELLO != 0; then + if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then REPLACE_FTELL=1 fi ]) diff --git a/modules/ftell b/modules/ftell index 8dbaf2e4c..891fa7243 100644 --- a/modules/ftell +++ b/modules/ftell @@ -23,7 +23,7 @@ Include: License: -LGPL +LGPLv2+ Maintainer: Bruno Haible diff --git a/modules/ftello b/modules/ftello index 6cce8470e..73aa81157 100644 --- a/modules/ftello +++ b/modules/ftello @@ -11,6 +11,8 @@ Depends-on: stdio extensions lseek [test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1] +# Just to guarantee consistency between ftell() and ftello(). +ftell configure.ac-early: AC_REQUIRE([AC_FUNC_FSEEKO]) -- 2.11.0