ftello: Provide a non-inline replacement of ftell().
authorBruno Haible <bruno@clisp.org>
Mon, 13 Jun 2011 15:33:59 +0000 (17:33 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Jun 2011 15:33:59 +0000 (17:33 +0200)
* 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
lib/stdio.in.h
m4/ftell.m4
modules/ftell
modules/ftello

index 6037c0c..d89b387 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-06-13  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        ftell: Move AC_LIBOBJ invocations to module description.
index 1ad8943..fee5b65 100644 (file)
@@ -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
index 00d7bbe..c529c50 100644 (file)
@@ -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
 ])
index 8dbaf2e..891fa72 100644 (file)
@@ -23,7 +23,7 @@ Include:
 <stdio.h>
 
 License:
-LGPL
+LGPLv2+
 
 Maintainer:
 Bruno Haible
index 6cce847..73aa811 100644 (file)
@@ -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])