diff --git a/png.c b/png.c index de8bd8be6..23ddc2915 100644 --- a/png.c +++ b/png.c @@ -996,8 +996,13 @@ png_colorspace_set_gamma(png_const_structrp png_ptr, * In 1.6.0 this test replaces the ones in pngrutil.c, in the gAMA chunk * handling code, which only required the value to be >0. */ -# define ERRMSG (defined PNG_TRANSFORM_MECH_SUPPORTED) &&\ - (defined PNG_ERROR_TEXT_SUPPORTED) +# if (defined PNG_TRANSFORM_MECH_SUPPORTED) &&\ + (defined PNG_ERROR_TEXT_SUPPORTED) +# define ERRMSG 1 +# else +# define ERRMSG 0 +# endif + # if ERRMSG png_const_charp errmsg; # endif diff --git a/pngpriv.h b/pngpriv.h index b6ceb95d0..c0f29512c 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -319,9 +319,13 @@ * is just the affirm code; there's no reason to allow configuration of this * option. */ -#define PNG_AFFIRM_TEXT (PNG_RELEASE_BUILD ?\ - (defined PNG_ERROR_TEXT_SUPPORTED) :\ - (defined PNG_WARNINGS_SUPPORTED) || (defined PNG_CONSOLE_IO_SUPPORTED)) +#if PNG_RELEASE_BUILD ?\ + (defined PNG_ERROR_TEXT_SUPPORTED) :\ + (defined PNG_WARNINGS_SUPPORTED) || (defined PNG_CONSOLE_IO_SUPPORTED) +# define PNG_AFFIRM_TEXT 1 +#else +# define PNG_AFFIRM_TEXT 0 +#endif /* PNG_AFFIRM_TEXT definition */ #define PNG_SRC_LINE (PNG_SRC_FILE + __LINE__)