From aecef098f95346ad249ca33ed96e4d0a0da7911d Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sat, 17 Apr 2010 18:03:02 -0500 Subject: [PATCH] [devel] Restored the ability to include optional pngusr.h --- ANNOUNCE | 2 +- CHANGES | 1 + pngpriv.h | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ANNOUNCE b/ANNOUNCE index 2aefc8693..9e583640c 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -161,9 +161,9 @@ version 1.5.0beta17 [April 17, 2010] in the new installed header file pnglibconf.h Removed the xcode project because it has not been updated to work with libpng-1.5.0. - Removed the ability to include optional pngusr.h version 1.5.0beta18 [April 17, 2010] + Restored the ability to include optional pngusr.h Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index dae777949..26900733f 100644 --- a/CHANGES +++ b/CHANGES @@ -2645,6 +2645,7 @@ version 1.5.0beta17 [April 17, 2010] Removed the ability to include optional pngusr.h version 1.5.0beta18 [April 17, 2010] + Restored the ability to include optional pngusr.h Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngpriv.h b/pngpriv.h index 95fae8e94..72439a6a4 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -25,6 +25,9 @@ #define PNGPRIV_H #define PNGLIB_BUILD +#ifdef PNG_USER_CONFIG +# include "pngusr.h" +#endif #include "png.h" #include "pnginfo.h" #include "pngstruct.h" @@ -77,6 +80,18 @@ # define PNG_WARNINGS_SUPPORTED #endif +/* If warnings or errors are turned off the code is disabled + * or redirected here. + */ +#ifndef PNG_WARNINGS_SUPPORTED +# define png_warning(s1,s2) ((void)0) +# define png_chunk_warning(s1,s2) ((void)0) +#endif +#ifndef PNG_ERROR_TEXT_SUPPORTED +# define png_error(s1,s2) png_err(s1) +# define png_chunk_error(s1,s2) png_err(s1) +#endif + /* Added at libpng version 1.4.0 */ #if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) # define PNG_CHECK_cHRM_SUPPORTED