From 40878fd6dcc178844a3f6a9ec56fab36394f4334 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Fri, 26 Apr 2024 13:20:18 -0400 Subject: [PATCH] fix: Restore STDERR in pngtest.c In "test: Add consistency checks for the PNG_LIBPNG_VER* number" [0] the `STDERR` macro was moved from outside an `ifdef` to inside an `ifdef`. This broke the code in the `else` of this `ifdef` which also uses the `STDERR` macro. Move `STDERR` back to where it was to avoid compile errors in the `else` case. [0] https://github.com/pnggroup/libpng/commit/cc8006c48d90cca8bf380fa69469b08f4edb00c5 Fixes: #560 Reviewed-by: Cosmin Truta Signed-off-by: Cosmin Truta --- pngtest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pngtest.c b/pngtest.c index 81da72126..ba2b7463e 100644 --- a/pngtest.c +++ b/pngtest.c @@ -45,6 +45,11 @@ #include "png.h" +/* This hack was introduced for historical reasons, and we are + * still keeping it in libpng-1.6.x for compatibility reasons. + */ +#define STDERR stdout + /* Generate a compiler error if there is an old png.h in the search path. */ typedef png_libpng_version_1_6_44_git Your_png_h_is_not_version_1_6_44_git; @@ -103,11 +108,6 @@ typedef png_libpng_version_1_6_44_git Your_png_h_is_not_version_1_6_44_git; typedef FILE * png_FILE_p; #endif -/* This hack was introduced for historical reasons, and we are - * still keeping it in libpng-1.6.x for compatibility reasons. - */ -#define STDERR stdout - #ifndef PNG_DEBUG # define PNG_DEBUG 0 #endif