diff --git a/libvips/deprecated/vips7compat.c b/libvips/deprecated/vips7compat.c index 6c9a9c34..94208559 100644 --- a/libvips/deprecated/vips7compat.c +++ b/libvips/deprecated/vips7compat.c @@ -5692,3 +5692,14 @@ vips_get_option_group( void ) return( option_group ); } + +/* We used to use this for system() back in the day. But it's awkward to make + * it work properly on win32, so this is nonw deprecated. + */ +FILE * +vips_popenf( const char *fmt, const char *mode, ... ) +{ + vips_error( "popenf", "%s", _( "deprecated" ) ); + return( NULL ); +} + diff --git a/libvips/include/vips/util.h b/libvips/include/vips/util.h index 9a0597e2..feb49f72 100644 --- a/libvips/include/vips/util.h +++ b/libvips/include/vips/util.h @@ -286,8 +286,6 @@ int vips_mkdirf( const char *name, ... ) int vips_rmdirf( const char *name, ... ) __attribute__((format(printf, 1, 2))); int vips_rename( const char *old_name, const char *new_name ); -FILE *vips_popenf( const char *fmt, const char *mode, ... ) - __attribute__((format(printf, 1, 3))); /** * VipsToken: diff --git a/libvips/include/vips/vips7compat.h b/libvips/include/vips/vips7compat.h index a8f10ba2..ac34a710 100644 --- a/libvips/include/vips/vips7compat.h +++ b/libvips/include/vips/vips7compat.h @@ -1221,6 +1221,9 @@ GOptionGroup *vips_get_option_group( void ); */ VipsWindow *vips_window_ref( VipsImage *im, int top, int height ); +FILE *vips_popenf( const char *fmt, const char *mode, ... ) + __attribute__((format(printf, 1, 3))); + /* This stuff is very, very old and should not be used by anyone now. */ #ifdef VIPS_ENABLE_ANCIENT diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c index eb527067..c78b0e0d 100644 --- a/libvips/iofuncs/util.c +++ b/libvips/iofuncs/util.c @@ -1191,40 +1191,6 @@ vips_isdirf( const char *name, ... ) return( result ); } -#ifdef OS_WIN32 -#ifndef popen -#define popen(b,m) _popen(b,m) -#endif -#ifndef pclose -#define pclose(f) _pclose(f) -#endif -#endif /*OS_WIN32*/ - -/* Do popen(), with printf-style args. - */ -FILE * -vips_popenf( const char *fmt, const char *mode, ... ) -{ - va_list args; - char buf[VIPS_PATH_MAX]; - FILE *fp; - - va_start( args, mode ); - (void) vips_vsnprintf( buf, VIPS_PATH_MAX, fmt, args ); - va_end( args ); - -#ifdef DEBUG - printf( "vips_popenf: running: %s\n", buf ); -#endif /*DEBUG*/ - - if( !(fp = popen( buf, mode )) ) { - vips_error( "popenf", "%s", strerror( errno ) ); - return( NULL ); - } - - return( fp ); -} - /* Make a directory. */ int diff --git a/libvips/iofuncs/vips.c b/libvips/iofuncs/vips.c index a1b61ab8..232773af 100644 --- a/libvips/iofuncs/vips.c +++ b/libvips/iofuncs/vips.c @@ -94,10 +94,6 @@ #include #include -#ifdef OS_WIN32 -#include -#endif /*OS_WIN32*/ - #include #include #include