]> granicus.if.org Git - libass/commitdiff
test: fix compilation with libpng 1.5, rename configure switch
authorGrigori Goronzy <greg@blackbox>
Wed, 16 Feb 2011 18:58:15 +0000 (19:58 +0100)
committerGrigori Goronzy <greg@blackbox>
Wed, 16 Feb 2011 18:58:15 +0000 (19:58 +0100)
libpng 1.5 renamed the jmpbuf variable to jmp_buf. Since direct access
to this variable is deprecated, it makes more sense to use the function
png_jmpbuf() instead.

Also, rename the --enable-png switch to --enable-test to make clear this
is a debugging option.

Initial patch by Alexis Ballier, aballier AT gentoo DOT org.

configure.ac
test/test.c

index 117b120491cee3403aef2784237631891ff31575..7e2d8d99aa268b8d01008077359b713b452841eb 100644 (file)
@@ -34,8 +34,8 @@ AC_SEARCH_LIBS([iconv_open], [iconv], AC_DEFINE(CONFIG_ICONV, 1, [use iconv]))
 AC_CHECK_LIB([m], [fabs])
 
 # Check for libraries via pkg-config
-AC_ARG_ENABLE([png], AS_HELP_STRING([--enable-png],
-    [enable png (test program) @<:@default=no@:>@]))
+AC_ARG_ENABLE([test], AS_HELP_STRING([--enable-test],
+    [enable test program (requires libpng) @<:@default=no@:>@]))
 AC_ARG_ENABLE([enca], AS_HELP_STRING([--disable-enca],
     [disable enca (charset autodetect) support @<:@default=check@:>@]))
 AC_ARG_ENABLE([fontconfig], AS_HELP_STRING([--disable-fontconfig],
@@ -66,7 +66,7 @@ PKG_CHECK_MODULES([ENCA], enca, [
 fi
 
 libpng=false
-if test x$enable_png = xyes; then
+if test x$enable_test = xyes; then
 PKG_CHECK_MODULES([LIBPNG], libpng >= 1.2.0, [
     CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
     LIBS="$LIBS $LIBPNG_LIBS"
index 2f9cba43d8e7c412dea4e71fc44c507216417b9c..432a44fbaa9bba3fe8f61e1a86d148f1ae07dfbf 100644 (file)
@@ -53,7 +53,7 @@ static void write_png(char *fname, image_t *img)
     info_ptr = png_create_info_struct(png_ptr);
     fp = NULL;
 
-    if (setjmp(png_ptr->jmpbuf)) {
+    if (setjmp(png_jmpbuf(png_ptr))) {
         png_destroy_write_struct(&png_ptr, &info_ptr);
         fclose(fp);
         return;