bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ftello on mingw


From: Bruno Haible
Subject: ftello on mingw
Date: Sat, 3 Apr 2010 13:26:40 +0100
User-agent: KMail/1.9.9

Likewise for the function:

  ../gllib/stdio.h:699: error: `ftello' was not declared in this scope

This should fix it:


2010-04-03  Bruno Haible  <address@hidden>

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

--- lib/stdio.in.h.orig Sat Apr  3 14:23:54 2010
+++ lib/stdio.in.h      Sat Apr  3 14:21:18 2010
@@ -402,22 +402,26 @@
 #   define ftello rpl_ftello
 #  endif
 _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
-#  if address@hidden@
-    /* In order to avoid that ftell gets defined as a macro here, the
-       developer can request the 'ftell' module.  */
-#   undef ftell
-#   define ftell rpl_ftell
+_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
+# else
+#  if ! @HAVE_FTELLO@
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
+# endif
+_GL_CXXALIASWARN (ftello);
+# if (@REPLACE_FTELLO@ || address@hidden@) && address@hidden@
+   /* 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.  */
+#  undef ftell
+#  define ftell rpl_ftell
 static inline long _GL_ARG_NONNULL ((1))
 rpl_ftell (FILE *f)
 {
   return ftello (f);
 }
-#  endif
-_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
-# else
-_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
 # endif
-_GL_CXXALIASWARN (ftello);
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FTELL_WARN /* Category 1, above.  */
 # undef ftell
--- m4/ftello.m4.orig   Sat Apr  3 14:23:54 2010
+++ m4/ftello.m4        Sat Apr  3 14:22:34 2010
@@ -1,4 +1,4 @@
-# ftello.m4 serial 5
+# ftello.m4 serial 6
 dnl Copyright (C) 2007, 2008, 2009, 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,
@@ -18,8 +18,14 @@
       AC_TRY_LINK([#include <stdio.h>], [ftello (stdin);],
         [gl_cv_func_ftello=yes], [gl_cv_func_ftello=no])
     ])
-  if test $gl_cv_func_ftello = no \
-      || test $gl_cv_var_stdin_large_offset = no; then
+  if test $gl_cv_func_ftello = no; then
+    HAVE_FTELLO=0
+  else
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FTELLO=1
+    fi
+  fi
+  if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
     gl_REPLACE_FTELLO
   fi
 ])
@@ -27,6 +33,4 @@
 AC_DEFUN([gl_REPLACE_FTELLO],
 [
   AC_LIBOBJ([ftello])
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FTELLO=1
 ])
--- m4/stdio_h.m4.orig  Sat Apr  3 14:23:54 2010
+++ m4/stdio_h.m4       Sat Apr  3 14:23:15 2010
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 28
+# stdio_h.m4 serial 29
 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,
@@ -100,6 +100,7 @@
   HAVE_DECL_VSNPRINTF=1;         AC_SUBST([HAVE_DECL_VSNPRINTF])
   HAVE_DPRINTF=1;                AC_SUBST([HAVE_DPRINTF])
   HAVE_FSEEKO=1;                 AC_SUBST([HAVE_FSEEKO])
+  HAVE_FTELLO=1;                 AC_SUBST([HAVE_FTELLO])
   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:23:54 2010
+++ modules/stdio       Sat Apr  3 14:22:57 2010
@@ -77,6 +77,7 @@
              -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_FTELLO''@|$(HAVE_FTELLO)|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

[Prev in Thread] Current Thread [Next in Thread]