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 b3ef5990b89ac25daaa213da1123c7becefee6a8..22858679d75262e521e433890951e3e83e3a34d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index 8b78d7bcc7c2eb554d140c5fc512d930595c4f74..8371df47afd178e46387b2834afd1613cebf6221 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