From fb61f0fa44d6ff665dd6e68efdb437b5e04ace8f Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Mon, 6 Jul 2020 17:28:18 +0200 Subject: [PATCH] Define ENABLE_DEPRECATED in config.h Do not check for VIPS_ENABLE_DEPRECATED as it could come from an earlier version of libvips. --- configure.ac | 1 + libvips/iofuncs/image.c | 4 ++-- libvips/iofuncs/init.c | 12 ++++++------ libvips/iofuncs/threadpool.c | 2 +- libvips/iofuncs/vector.c | 2 +- tools/vips.c | 24 ++++++++++++------------ 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index b095b207..c0df2116 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,7 @@ if test x"$enable_deprecated" != x"no"; then VIPS_ENABLE_DEPRECATED=1 enable_deprecated=yes fi +AC_DEFINE_UNQUOTED(ENABLE_DEPRECATED,$VIPS_ENABLE_DEPRECATED,[define to build deprecated components]) AM_CONDITIONAL(ENABLE_DEPRECATED, [test x"$enable_deprecated" = x"yes"]) # this gets pasted into version.h as a #define diff --git a/libvips/iofuncs/image.c b/libvips/iofuncs/image.c index f2acf931..2516351d 100644 --- a/libvips/iofuncs/image.c +++ b/libvips/iofuncs/image.c @@ -801,7 +801,7 @@ static void vips_image_add_progress( VipsImage *image ) { if( vips__progress || -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED g_getenv( "VIPS_PROGRESS" ) || g_getenv( "IM_PROGRESS" ) ) { #else @@ -2517,7 +2517,7 @@ vips_get_disc_threshold( void ) */ threshold = 100 * 1024 * 1024; -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED if( (env = g_getenv( "VIPS_DISC_THRESHOLD" )) || (env = g_getenv( "IM_DISC_THRESHOLD" )) ) #else diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 1ee28194..46db91c3 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -99,7 +99,7 @@ #include #include -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED #include #endif @@ -463,7 +463,7 @@ vips_init( const char *argv0 ) g_free( locale ); bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ); -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED if( g_getenv( "VIPS_INFO" ) || g_getenv( "IM_INFO" ) ) #else @@ -496,7 +496,7 @@ vips_init( const char *argv0 ) vips__meta_init_types(); vips__interpolate_init(); -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED im__format_init(); #endif @@ -531,7 +531,7 @@ vips_init( const char *argv0 ) (void) vips_load_plugins( "%s/vips-plugins-%d.%d", libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ); -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED /* Load up any vips7 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. @@ -582,7 +582,7 @@ vips_init( const char *argv0 ) * set up if you are using libvips from something like Ruby. Allow this * env var hack as a workaround. */ -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED if( g_getenv( "VIPS_WARNING" ) || g_getenv( "IM_WARNING" ) ) #else @@ -693,7 +693,7 @@ vips_shutdown( void ) vips_cache_drop_all(); -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED im_close_plugins(); #endif diff --git a/libvips/iofuncs/threadpool.c b/libvips/iofuncs/threadpool.c index 92497af3..00ee1375 100644 --- a/libvips/iofuncs/threadpool.c +++ b/libvips/iofuncs/threadpool.c @@ -426,7 +426,7 @@ vips_concurrency_get( void ) */ if( vips__concurrency > 0 ) nthr = vips__concurrency; -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED else if( ((str = g_getenv( "VIPS_CONCURRENCY" )) || (str = g_getenv( "IM_CONCURRENCY" ))) && #else diff --git a/libvips/iofuncs/vector.c b/libvips/iofuncs/vector.c index 5af1e61e..e773d39e 100644 --- a/libvips/iofuncs/vector.c +++ b/libvips/iofuncs/vector.c @@ -102,7 +102,7 @@ vips_vector_init( void ) /* Look for the environment variable VIPS_NOVECTOR and use that to turn * off as well. */ -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED if( g_getenv( "VIPS_NOVECTOR" ) || g_getenv( "IM_NOVECTOR" ) ) #else diff --git a/tools/vips.c b/tools/vips.c index 6d0990be..6aeb4a86 100644 --- a/tools/vips.c +++ b/tools/vips.c @@ -97,7 +97,7 @@ #include #include -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED #include #endif @@ -186,7 +186,7 @@ static GOptionEntry main_option[] = { { NULL } }; -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED typedef void *(*map_name_fn)( im_function * ); /* Loop over a package. @@ -253,7 +253,7 @@ list_function( im_function *func ) static int print_list( int argc, char **argv ) { -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED if( !argv[0] || strcmp( argv[0], "packages" ) == 0 ) im_map_packages( (VSListMap2Fn) list_package, NULL ); else if( strcmp( argv[0], "classes" ) == 0 ) @@ -268,7 +268,7 @@ print_list( int argc, char **argv ) (VipsTypeMapFn) list_class, NULL ); } else { -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED if( map_name( argv[0], list_function ) ) vips_error_exit( "unknown package \"%s\"", argv[0] ); #else @@ -279,7 +279,7 @@ print_list( int argc, char **argv ) return( 0 ); } -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED /* Print "ln -s" lines for this package. */ static void * @@ -331,7 +331,7 @@ isvips( const char *name ) return( vips_isprefix( "vips", name ) ); } -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED /* Print a usage string from an im_function descriptor. */ static void @@ -426,13 +426,13 @@ static GOptionEntry empty_options[] = { }; static ActionEntry actions[] = { -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED { "list", N_( "list classes|packages|all|package-name|operation-name" ), #else { "list", N_( "list classes|all|operation-name" ), #endif &empty_options[0], print_list }, -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED { "links", N_( "generate links for vips/bin" ), &empty_options[0], print_links }, #endif @@ -515,7 +515,7 @@ main( int argc, char **argv ) GOptionGroup *main_group; GOptionGroup *group; VipsOperation *operation; -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED im_function *fn; #endif int i, j; @@ -603,10 +603,10 @@ main( int argc, char **argv ) ; if( main_option_plugin ) { -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED if( !im_load_plugin( main_option_plugin ) ) vips_error_exit( NULL ); -#else /*!VIPS_ENABLE_DEPRECATED*/ +#else /*!ENABLE_DEPRECATED*/ GModule *module; module = g_module_open( main_option_plugin, G_MODULE_BIND_LAZY ); @@ -672,7 +672,7 @@ main( int argc, char **argv ) break; } -#if VIPS_ENABLE_DEPRECATED +#if ENABLE_DEPRECATED /* Could be a vips7 im_function. We need to test for vips7 first, * since we don't want to use the vips7 compat wrappers in vips8 * unless we have to. They don't support all args types.