Remove 'defined' within macro

This eliminates the use of 'defined' within macros that get substituted
on #if lines; see the previous patch for a more detailed discussion.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler 2016-12-26 16:46:30 -08:00
parent 0ea7a09ced
commit 512336676e
2 changed files with 14 additions and 5 deletions

9
png.c
View File

@ -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

View File

@ -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__)