Markus Mützel wrote:
> With those, liboctave.dll still used "ftell".
> It took me a while to assure it isn't coming from anywhere else. But the only 
> place that made use of that symbol is from "gnulib/lib/ftello.c".
> ... 
> But no match for HAVE_FTELLO in "config.in.h" nor in "config.h".
> 
> With the following change in gnulib, liboctave.dll no longer uses "ftell":
> 
> diff --git a/lib/ftello.c b/lib/ftello.c
> index 88247bca8e..29158b354d 100644
> --- a/lib/ftello.c
> +++ b/lib/ftello.c
> @@ -30,7 +30,7 @@
>  off_t
>  ftello (FILE *fp)
>  #undef ftello
> -#if !HAVE_FTELLO
> +#if !HAVE_FSEEKO
>  # undef ftell
>  # define ftello ftell
>  #endif
> 
> Does that look more reasonable?

Indeed this use of HAVE_FTELLO, which is defined nowhere, is a bug. This patch
fixes it. It has an effect on mingw and on 32-bit Solaris OpenIndiana.
With it, on 32-bit Solaris OpenIndiana, ftello() now works fine on large files.


2024-11-14  Bruno Haible  <[email protected]>

        ftello: Fix override on mingw and 32-bit Solaris OpenIndiana.
        Reported by Markus Mützel <[email protected]> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00108.html>.
        * m4/ftello.m4 (gl_PREREQ_FTELLO): Define the C macro HAVE_FTELLO.

diff --git a/m4/ftello.m4 b/m4/ftello.m4
index 2bdb63148f..8bd5d0083b 100644
--- a/m4/ftello.m4
+++ b/m4/ftello.m4
@@ -1,5 +1,5 @@
 # ftello.m4
-# serial 16
+# serial 17
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -158,6 +158,10 @@ AC_DEFUN([gl_FUNC_FTELLO]
 # Prerequisites of lib/ftello.c.
 AC_DEFUN([gl_PREREQ_FTELLO],
 [
+  if test $gl_cv_func_ftello != no; then
+    AC_DEFINE([HAVE_FTELLO], [1],
+      [Define to 1 if the system has the ftello function.])
+  fi
   dnl Native Windows has the function _ftelli64. mingw hides it, but mingw64
   dnl makes it usable again.
   AC_CHECK_FUNCS([_ftelli64])




Reply via email to