diff --git a/ANNOUNCE b/ANNOUNCE index cc31f1cda..93c5e72ba 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -40,6 +40,7 @@ Version 1.5.15beta02 [February 5, 2013] be made to pnglibconf.mak Fix typo in Makefile.am, fix scripts/pnglibconf.mak and makefile.std Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.13 + Fix 'setting' handling in options.awk and fixed palette_max API Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index a40a18ca8..953ec15e1 100644 --- a/CHANGES +++ b/CHANGES @@ -3997,6 +3997,7 @@ Version 1.5.15beta02 [February 5, 2013] be made to pnglibconf.mak Fix typo in Makefile.am, fix scripts/pnglibconf.mak and makefile.std Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.13 + Fix 'setting' handling in options.awk and fixed palette_max API =========================================================================== NOTICE November 17, 2012: diff --git a/png.h b/png.h index 98158e93a..d71de375b 100644 --- a/png.h +++ b/png.h @@ -2655,7 +2655,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr, int allowed)); -PNG_EXPORT(235, void, png_get_palette_max, (png_structp png_ptr, +PNG_EXPORT(235, int, png_get_palette_max, (png_const_structp png_ptr, png_const_infop info_ptr)); #endif diff --git a/pngget.c b/pngget.c index 076ac4f43..fb318dd4a 100644 --- a/pngget.c +++ b/pngget.c @@ -1129,7 +1129,7 @@ png_get_io_chunk_name (png_structp png_ptr) #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED int PNGAPI -png_get_max_palette_index(png_const_structp png_ptr, png_const_infop info_ptr) +png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return png_ptr->num_palette_max; @@ -1138,5 +1138,4 @@ png_get_max_palette_index(png_const_structp png_ptr, png_const_infop info_ptr) } #endif - #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/scripts/options.awk b/scripts/options.awk index c5f6eac54..41b6ddd02 100755 --- a/scripts/options.awk +++ b/scripts/options.awk @@ -48,6 +48,8 @@ BEGIN{ dq="@'" # For a single double quote start=" PNG_DFN \"" # Start stuff to output (can't contain a "!) end="\" " # End stuff to output + subs="@\" " # Substitute start (substitute a C macro) + sube=" \"@" # Substitute end comment=start "/*" # Comment start cend="*/" end # Comment end def=start "#define PNG_" # Arbitrary define @@ -497,10 +499,17 @@ END{ # All the requirements have been processed, output # this setting. if (deb) print "setting", i + deflt = defaults[i] + # A leading @ means leave it unquoted so the preprocessor + # can substitute the build time value + if (deflt ~ /^ @/) + deflt = " " subs substr(deflt, 3) sube + # Remove any spurious trailing spaces + sub(/ *$/,"",deflt) print "" >out print "/* setting: ", i >out print " * requires:" setting[i] >out - print " * default: ", defaults[i], "*/" >out + print " * default: ", defaults[i] defltinfo, "*/" >out if (defaults[i] == "") { # no default, only check if defined print "#ifdef PNG_" i >out } @@ -512,13 +521,14 @@ END{ if (defaults[i] != "") { # default handling print "#ifdef PNG_" i >out } - print def i, "PNG_" i end >out + # PNG_ is defined, so substitute the value: + print def i, subs "PNG_" i sube end >out if (defaults[i] != "") { print "#else /*default*/" >out # And add the default definition for the benefit # of later settings an options test: - print "# define PNG_" i defaults[i] >out - print def i defaults[i] end >out + print "# define PNG_" i deflt >out + print def i deflt end >out } print "#endif" >out