diff --git a/ANNOUNCE b/ANNOUNCE index 7b498e2f2..f33c61c63 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -Libpng 1.6.18beta04 - May 6, 2015 +Libpng 1.6.18beta04 - May 7, 2015 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -46,7 +46,9 @@ Version 1.6.18beta03 [May 6, 2015] and an example PNG generation tool, contrib/examples/genpng.c (John Bowler). -Version 1.6.18beta04 [May 6, 2015] +Version 1.6.18beta04 [May 7, 2015] + PNG_RELEASE_BUILD replaces tests where the code depended on the build base + type and can be defined on the command line, allowing testing in beta builds. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 516b4d99c..6f022bf93 100644 --- a/CHANGES +++ b/CHANGES @@ -5226,7 +5226,9 @@ Version 1.6.18beta03 [May 6, 2015] and an example PNG generation tool, contrib/examples/genpng.c (John Bowler). -Version 1.6.18beta04 [May 6, 2015] +Version 1.6.18beta04 [May 7, 2015] + PNG_RELEASE_BUILD replaces tests where the code depended on the build base + type and can be defined on the command line, allowing testing in beta builds. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngpriv.h b/pngpriv.h index b514c4fd6..56ee4f878 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -300,6 +300,22 @@ # define PNG_DLL_EXPORT #endif +/* This is a global switch to set the compilation for an installed system + * (a release build). It can be set for testing debug builds to ensure that + * they will compile when the build type is switched to RC or STABLE, the + * default is just to use PNG_LIBPNG_BUILD_BASE_TYPE. Set this in CPPFLAGS + * with either: + * + * -DPNG_RELEASE_BUILD Turns on the release compile path + * -DPNG_RELEASE_BUILD=0 Turns it off + * or in your pngusr.h with + * #define PNG_RELEASE_BUILD=1 Turns on the release compile path + * #define PNG_RELEASE_BUILD=0 Turns it off + */ +#ifndef PNG_RELEASE_BUILD +# define PNG_RELEASE_BUILD (PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC) +#endif + /* SECURITY and SAFETY: * * libpng is built with support for internal limits on image dimensions and diff --git a/pngread.c b/pngread.c index 6764dbe56..6239503e2 100644 --- a/pngread.c +++ b/pngread.c @@ -63,7 +63,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, /* In stable builds only warn if an application error can be completely * handled. */ -# if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +# if PNG_RELEASE_BUILD png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN; # endif # endif diff --git a/pngrutil.c b/pngrutil.c index 48edeb570..a8ff1ce11 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -341,7 +341,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) * are minimal. */ (void)png_safecat(msg, (sizeof msg), 4, " using zstream"); -#if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +#if PNG_RELEASE_BUILD png_chunk_warning(png_ptr, msg); png_ptr->zowner = 0; #else diff --git a/pngwrite.c b/pngwrite.c index 64b2438f2..305e2df78 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -543,7 +543,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, /* App warnings are warnings in release (or release candidate) builds but * are errors during development. */ -#if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +#if PNG_RELEASE_BUILD png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN; #endif diff --git a/pngwutil.c b/pngwutil.c index b289671d1..fd7b5a8b6 100644 --- a/pngwutil.c +++ b/pngwutil.c @@ -308,7 +308,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner, */ (void)png_safecat(msg, (sizeof msg), 10, " using zstream"); #endif -#if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +#if PNG_RELEASE_BUILD png_warning(png_ptr, msg); /* Attempt sane error recovery */