From edd8cd8de79b5872627d2ccd5817e0e6c1a2da70 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 26 Apr 2007 09:42:29 +0000 Subject: [PATCH] Verify that off_t is the same size as long when we assume it. --- ChangeLog | 6 ++++++ lib/stdio_.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b3ef5990b8..22858679d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-26 Bruno Haible + + * 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 Ensure fseeko, ftello are declared on glibc systems. diff --git a/lib/stdio_.h b/lib/stdio_.h index 8b78d7bcc7..8371df47af 100644 --- a/lib/stdio_.h +++ b/lib/stdio_.h @@ -38,7 +38,7 @@ #include #include -#if @GNULIB_FFLUSH@ && @REPLACE_FFLUSH@ +#if (@GNULIB_FFLUSH@ && @REPLACE_FFLUSH@) || (@GNULIB_FSEEKO@ && !@HAVE_FSEEKO@) || (@GNULIB_FTELLO@ && !@HAVE_FTELLO@) /* Get off_t. */ # include #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 -- 2.30.2