]> Savannah Git Hosting - gnulib.git/commitdiff
fseeko: On mingw, don't use the hidden function _fseeki64.
authorBruno Haible <bruno@clisp.org>
Sat, 12 May 2018 18:37:47 +0000 (20:37 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 12 May 2018 18:37:47 +0000 (20:37 +0200)
Reported by Eli Zaretskii <eliz@gnu.org>.

* m4/fseeko.m4 (gl_PREREQ_FSEEKO): Test whether _fseeki64 is declared.
* lib/fseeko.c (fseeko): Use _fseeki64 only if it is declared.

ChangeLog
lib/fseeko.c
m4/fseeko.m4

index 88630dd23a2fc1f0b2480bf4d01c3fca4940d82d..6085d38f1d5550d53fb09a14c23a05e410daac9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-05-12  Bruno Haible  <bruno@clisp.org>
+
+       fseeko: On mingw, don't use the hidden function _fseeki64.
+       Reported by Eli Zaretskii <eliz@gnu.org>.
+       * m4/fseeko.m4 (gl_PREREQ_FSEEKO): Test whether _fseeki64 is declared.
+       * lib/fseeko.c (fseeko): Use _fseeki64 only if it is declared.
+
 2018-05-12  Bruno Haible  <bruno@clisp.org>
 
        glob: Choose 'dirent_type' in a way that works better on mingw.
index e5c5172e788059e09a7f946620c419028ea031c3..d47481d8ff3a7cc0220eaeb79f9b4d0dc1355d75 100644 (file)
@@ -33,9 +33,9 @@ fseeko (FILE *fp, off_t offset, int whence)
 #endif
 #if _GL_WINDOWS_64_BIT_OFF_T
 # undef fseeko
-# if HAVE__FSEEKI64 /* msvc, mingw64 */
+# if HAVE__FSEEKI64 && HAVE_DECL__FSEEKI64 /* msvc, mingw since msvcrt8.0, mingw64 */
 #  define fseeko _fseeki64
-# else /* mingw */
+# else /* mingw before msvcrt8.0 */
 #  define fseeko fseeko64
 # endif
 #endif
index 8967cf1539572e987313f97fe57c98e49232c10f..86c246e8996d8cdd357be6fa01229ae933cf0836 100644 (file)
@@ -1,4 +1,4 @@
-# fseeko.m4 serial 18
+# fseeko.m4 serial 19
 dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -68,7 +68,10 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
 # Prerequisites of lib/fseeko.c.
 AC_DEFUN([gl_PREREQ_FSEEKO],
 [
-  dnl Native Windows has the function _fseeki64. mingw hides it, but mingw64
-  dnl makes it usable again.
+  dnl Native Windows has the function _fseeki64. mingw hides it in some
+  dnl circumstances, but mingw64 makes it usable again.
   AC_CHECK_FUNCS([_fseeki64])
+  if test $ac_cv_func__fseeki64 = yes; then
+    AC_CHECK_DECLS([_fseeki64])
+  fi
 ])