fix function name error on old glibs

see https://github.com/libvips/libvips/pull/1211#discussion_r248280743
This commit is contained in:
John Cupitt 2019-01-16 13:37:50 +00:00
parent 00982f6297
commit 10290c3dd6
1 changed files with 4 additions and 2 deletions

View File

@ -1666,11 +1666,13 @@ vips_image_temp_name( char *name, int size )
{
static int global_serial = 0;
/* Old glibs named this differently.
*/
int serial =
#if GLIB_CHECK_VERSION( 2, 30, 0 )
g_atomic_int_add( &global_serial, 1);
g_atomic_int_add( &global_serial, 1 );
#else
g_atomic_exchange_and_add( &global_serial, 1);
g_atomic_int_exchange_and_add( &global_serial, 1 );
#endif
vips_snprintf( name, size, "temp-%d", serial );