Similarly for the fseeko function on mingw. I'm seeing this error:

  ../gllib/stdio.h:632: error: `fseeko' was not declared in this scope

This should fix it.


2010-04-03  Bruno Haible  <br...@clisp.org>

        fseeko: Fix C++ test error on mingw.
        * lib/stdio.in.h (fseeko): Use modern idiom.
        * m4/fseeko.m4 (gl_FUNC_FSEEKO): Distinguish the case that the function
        is missing and that it needs to be replaced.
        (gl_REPLACE_FSEEKO): Don't set REPLACE_FSEEKO here.
        * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_FSEEKO.
        * modules/stdio (Makefile.am): Substitute HAVE_FSEEKO.

--- lib/stdio.in.h.orig Sat Apr  3 14:03:46 2010
+++ lib/stdio.in.h      Sat Apr  3 14:02:20 2010
@@ -322,30 +322,35 @@
 #  undef fseek
 # endif
 # if @REPLACE_FSEEKO@
-/* Provide fseek, fseeko functions that are aware of a preceding
-   fflush(), and which detect pipes.  */
+/* Provide an fseeko function that is aware of a preceding fflush(), and which
+   detects pipes.  */
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef fseeko
 #   define fseeko rpl_fseeko
 #  endif
 _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
                                _GL_ARG_NONNULL ((1)));
-#  if !...@gnulib_fseek@
-    /* In order to avoid that fseek gets defined as a macro here, the
-       developer can request the 'fseek' module.  */
-#   undef fseek
-#   define fseek rpl_fseek
+_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
+# else
+#  if ! @HAVE_FSEEKO@
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (fseeko);
+# if (@REPLACE_FSEEKO@ || !...@have_fseeko@) && !...@gnulib_fseek@
+   /* Provide an fseek function that is consistent with fseeko.  */
+   /* In order to avoid that fseek gets defined as a macro here, the
+      developer can request the 'fseek' module.  */
+#  undef fseek
+#  define fseek rpl_fseek
 static inline int _GL_ARG_NONNULL ((1))
 rpl_fseek (FILE *fp, long offset, int whence)
 {
   return fseeko (fp, offset, whence);
 }
-#  endif
-_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
-# else
-_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
 # endif
-_GL_CXXALIASWARN (fseeko);
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FSEEK_WARN /* Category 1, above.  */
 # undef fseek
--- m4/fseeko.m4.orig   Sat Apr  3 14:03:46 2010
+++ m4/fseeko.m4        Sat Apr  3 13:55:55 2010
@@ -1,4 +1,4 @@
-# fseeko.m4 serial 7
+# fseeko.m4 serial 8
 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,
@@ -19,8 +19,14 @@
 ]], [fseeko (stdin, 0, 0);])],
         [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
     ])
-  if test $gl_cv_func_fseeko = no \
-      || test $gl_cv_var_stdin_large_offset = no; then
+  if test $gl_cv_func_fseeko = no; then
+    HAVE_FSEEKO=0
+  else
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FSEEKO=1
+    fi
+  fi
+  if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
     gl_REPLACE_FSEEKO
   fi
 ])
@@ -28,8 +34,6 @@
 AC_DEFUN([gl_REPLACE_FSEEKO],
 [
   AC_LIBOBJ([fseeko])
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FSEEKO=1
   dnl If we are also using the fseek module, then fseek needs replacing, too.
   m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK])
 ])
--- m4/stdio_h.m4.orig  Sat Apr  3 14:03:46 2010
+++ m4/stdio_h.m4       Sat Apr  3 14:03:10 2010
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 27
+# stdio_h.m4 serial 28
 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,
@@ -99,6 +99,7 @@
   HAVE_DECL_SNPRINTF=1;          AC_SUBST([HAVE_DECL_SNPRINTF])
   HAVE_DECL_VSNPRINTF=1;         AC_SUBST([HAVE_DECL_VSNPRINTF])
   HAVE_DPRINTF=1;                AC_SUBST([HAVE_DPRINTF])
+  HAVE_FSEEKO=1;                 AC_SUBST([HAVE_FSEEKO])
   HAVE_RENAMEAT=1;               AC_SUBST([HAVE_RENAMEAT])
   HAVE_VASPRINTF=1;              AC_SUBST([HAVE_VASPRINTF])
   HAVE_VDPRINTF=1;               AC_SUBST([HAVE_VDPRINTF])
--- modules/stdio.orig  Sat Apr  3 14:03:46 2010
+++ modules/stdio       Sat Apr  3 14:02:46 2010
@@ -76,6 +76,7 @@
              -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
              -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
              -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+             -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
              -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
              -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
              -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \


Reply via email to