Define ENABLE_DEPRECATED in config.h

Do not check for VIPS_ENABLE_DEPRECATED as it could
come from an earlier version of libvips.
This commit is contained in:
Kleis Auke Wolthuizen 2020-07-06 17:28:18 +02:00
parent 6329d35048
commit fb61f0fa44
6 changed files with 23 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -99,7 +99,7 @@
#include <vips/internal.h>
#include <vips/vector.h>
#if VIPS_ENABLE_DEPRECATED
#if ENABLE_DEPRECATED
#include <vips/vips7compat.h>
#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

View File

@ -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

View File

@ -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

View File

@ -97,7 +97,7 @@
#include <vips/vips.h>
#include <vips/internal.h>
#if VIPS_ENABLE_DEPRECATED
#if ENABLE_DEPRECATED
#include <vips/vips7compat.h>
#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.