Verify that off_t is the same size as long when we assume it.
authorBruno Haible <bruno@clisp.org>
Thu, 26 Apr 2007 09:42:29 +0000 (09:42 +0000)
committerBruno Haible <bruno@clisp.org>
Thu, 26 Apr 2007 09:42:29 +0000 (09:42 +0000)
ChangeLog
lib/stdio_.h

index b3ef599..2285867 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-04-26  Bruno Haible  <bruno@clisp.org>
 
+       * lib/stdio_.h (fseeko, ftello): Check that off_t has the same size as
+       'long' when we assume it.
+       Suggested by Eric Blake.
+
+2007-04-26  Bruno Haible  <bruno@clisp.org>
+
        Ensure fseeko, ftello are declared on glibc systems.
        * modules/fflush (configure.ac-early): Require AC_FUNC_FSEEKO.
        * modules/fseeko (configure.ac-early): Likewise.
index 8b78d7b..8371df4 100644 (file)
@@ -38,7 +38,7 @@
 #include <stdarg.h>
 #include <stddef.h>
 
-#if @GNULIB_FFLUSH@ && @REPLACE_FFLUSH@
+#if (@GNULIB_FFLUSH@ && @REPLACE_FFLUSH@) || (@GNULIB_FSEEKO@ && !@HAVE_FSEEKO@) || (@GNULIB_FTELLO@ && !@HAVE_FTELLO@)
 /* Get off_t.  */
 # include <sys/types.h>
 #endif
@@ -220,6 +220,7 @@ extern int fseeko (FILE *fp, off_t offset, int whence);
 #elif @GNULIB_FSEEKO@
 # if !@HAVE_FSEEKO@
 /* Assume 'off_t' is the same type as 'long'.  */
+typedef int verify_fseeko_types[2 * (sizeof (off_t) == sizeof (long)) - 1];
 #  define fseeko fseek
 # endif
 #else
@@ -233,6 +234,7 @@ extern int fseeko (FILE *fp, off_t offset, int whence);
 #if @GNULIB_FTELLO@
 # if !@HAVE_FTELLO@
 /* Assume 'off_t' is the same type as 'long'.  */
+typedef int verify_ftello_types[2 * (sizeof (off_t) == sizeof (long)) - 1];
 #  define ftello ftell
 # endif
 #else