From 24c07cfde2384b4e76853e00f147e8f19d302f17 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 12 Jan 2018 11:56:17 +0000 Subject: [PATCH] revert an accidental ABI break the new window manager code in 8.6.1 changed the prototype of an internal function which was visible in the public API this patch renames the function, adds it to an internal header instead, and adds a stub for the old prototype see https://github.com/jcupitt/libvips/issues/854 --- ChangeLog | 1 + libvips/include/vips/internal.h | 5 +++++ libvips/include/vips/private.h | 4 ---- libvips/include/vips/vips7compat.h | 4 ++++ libvips/iofuncs/region.c | 2 +- libvips/iofuncs/window.c | 12 ++++++++++-- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9752d897..ca2331a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 5/1/18 started 8.6.2 - vips_sink_screen() keeps a ref to the input image ... stops a rare race +- fix a minor accidental ABI break in 8.6.0 -> 8.6.1 [remicollet] 10/12/17 started 8.6.1 - fix mmap window new/free cycling diff --git a/libvips/include/vips/internal.h b/libvips/include/vips/internal.h index 1b9ae9de..679c6a02 100644 --- a/libvips/include/vips/internal.h +++ b/libvips/include/vips/internal.h @@ -257,6 +257,11 @@ void vips__reorder_init( void ); int vips__reorder_set_input( VipsImage *image, VipsImage **in ); void vips__reorder_clear( VipsImage *image ); +/* Window manager API. + */ +VipsWindow *vips_window_take( VipsWindow *window, + VipsImage *im, int top, int height ); + #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/libvips/include/vips/private.h b/libvips/include/vips/private.h index 2a06b0ba..a1be3c42 100644 --- a/libvips/include/vips/private.h +++ b/libvips/include/vips/private.h @@ -71,10 +71,6 @@ typedef struct { size_t length; /* Size of window */ } VipsWindow; -/* window manager. - */ -VipsWindow *vips_window_ref( VipsWindow *window, - struct _VipsImage *im, int top, int height ); int vips_window_unref( VipsWindow *window ); void vips_window_print( VipsWindow *window ); diff --git a/libvips/include/vips/vips7compat.h b/libvips/include/vips/vips7compat.h index 95c94b72..e18a4213 100644 --- a/libvips/include/vips/vips7compat.h +++ b/libvips/include/vips/vips7compat.h @@ -1227,6 +1227,10 @@ int vips_check_dmask_1d( const char *domain, DOUBLEMASK *mask ); GOptionGroup *vips_get_option_group( void ); +/* old window manager API + */ +VipsWindow *vips_window_ref( VipsImage *im, int top, int height ); + #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/libvips/iofuncs/region.c b/libvips/iofuncs/region.c index 98211ff4..48337d44 100644 --- a/libvips/iofuncs/region.c +++ b/libvips/iofuncs/region.c @@ -678,7 +678,7 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) /* No complete image data ... but we can use a rolling window. */ reg->type = VIPS_REGION_WINDOW; - if( !(reg->window = vips_window_ref( reg->window, image, + if( !(reg->window = vips_window_take( reg->window, image, clipped.top, clipped.height )) ) return( -1 ); diff --git a/libvips/iofuncs/window.c b/libvips/iofuncs/window.c index 3721c5d2..e276074b 100644 --- a/libvips/iofuncs/window.c +++ b/libvips/iofuncs/window.c @@ -342,10 +342,18 @@ vips_window_find( VipsImage *im, int top, int height ) return( window ); } -/* Update a ref to a window to make it enclose top/height. +/* Old API. Just a compat stub now. */ VipsWindow * -vips_window_ref( VipsWindow *window, VipsImage *im, int top, int height ) +vips_window_ref( VipsImage *im, int top, int height ) +{ + return( NULL ); +} + +/* Update a window to make it enclose top/height. + */ +VipsWindow * +vips_window_take( VipsWindow *window, VipsImage *im, int top, int height ) { int margin;