From 6946ee1b9c57b77dab3e5a17a8c4c71d38d8c781 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 7 Aug 2008 11:12:18 +0000 Subject: [PATCH] stuff --- ChangeLog | 1 + include/vips/vips.h | 10 +++++++++- libsrc/iofuncs/im_init_world.c | 13 +++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6a0725d1..b8d682b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,7 @@ - added IM_LIBDIR, im_guess_libdir() - load plugins from libdir/vips-x.x on startup - added meta get/set int/double/string to C++ API +- remove time_t from vips.h, check size in im_init_world, thanks nicola 25/1/08 started 7.14.0 - bump all version numbers for new stable diff --git a/include/vips/vips.h b/include/vips/vips.h index 630f057d..d97b1234 100644 --- a/include/vips/vips.h +++ b/include/vips/vips.h @@ -38,8 +38,12 @@ * 7/11/07 * - added preclose and evalstart callbacks * - brought time struct in here + * 7/3/08 + * - MAGIC values should be unsigned * 2/7/08 * - added invalidate callbacks + * 7/8/08 + * - remove time_t, thanks nicola */ /* @@ -238,10 +242,14 @@ typedef struct { /* Struct we keep a record of execution time in. Passed to eval callback, so * it can assess progress. + * + * The 'unused' field is there for binary compatibility, it used to be a + * time_t. sizeof(time_t)==8 is checked in libsrc/iofuncs/im_init_world.c. + * We don't want to include time.h in vips.h if we don't have to. */ typedef struct { struct im__IMAGE *im; /* Image we are part of */ - time_t unused; /* FIXME ... for compatibility */ + char unused[8]; /* FIXME ... for binary compatibility */ int run; /* Time we have been running */ int eta; /* Estimated seconds of computation left */ gint64 tpels; /* Number of pels we expect to calculate */ diff --git a/libsrc/iofuncs/im_init_world.c b/libsrc/iofuncs/im_init_world.c index 3b2186e8..4fbcc0d5 100644 --- a/libsrc/iofuncs/im_init_world.c +++ b/libsrc/iofuncs/im_init_world.c @@ -19,6 +19,8 @@ * - progress feedback option * 5/8/08 * - load plugins from libdir/vips-x.x + * 7/8/08 + * - check sizeof(time_t), thanks nicola */ /* @@ -60,6 +62,10 @@ #include #include +/* Needed for the sizeof(time_t)==8 check, see vips.h + */ +#include + #ifdef HAVE_LIBOIL #include #endif /*HAVE_LIBOIL*/ @@ -135,6 +141,13 @@ im_init_world( const char *argv0 ) */ im__meta_init_types(); + /* See vips.h ... we used to have a time_t in part of the header, + * check this. + */ + if( sizeof( time_t ) != 8 ) + im_warn( "im_init_world", _( "sizeof( time_t ) != 8: " + "ABI break possible" ) ); + /* Load up any plugins in the vips libdir. We don't error on failure, * it's too annoying to have VIPS refuse to start because of a broken * plugin.