[devel] Moved replacements for png_error() and png_warning() from the
contrib/pngminim project to pngerror.c, for use when warnings or
errors are disabled via PNG_NO_WARN or PNG_NO_ERROR_TEXT, to avoid
storing unneeded error/warning text.
diff --git a/ANNOUNCE b/ANNOUNCE
index 9e58364..3f6845b 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -164,6 +164,11 @@
version 1.5.0beta18 [April 17, 2010]
Restored the ability to include optional pngusr.h
+ Moved replacements for png_error() and png_warning() from the
+ contrib/pngminim project to pngerror.c, for use when warnings or
+ errors are disabled via PNG_NO_WARN or PNG_NO_ERROR_TEXT, to avoid
+ storing unneeded error/warning text.
+ Updated contrib/pngminim project to work with the new pnglibconf.h
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
diff --git a/CHANGES b/CHANGES
index 2690073..8007bf3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2646,6 +2646,11 @@
version 1.5.0beta18 [April 17, 2010]
Restored the ability to include optional pngusr.h
+ Moved replacements for png_error() and png_warning() from the
+ contrib/pngminim project to pngerror.c, for use when warnings or
+ errors are disabled via PNG_NO_WARN or PNG_NO_ERROR_TEXT, to avoid
+ storing unneeded error/warning text.
+ Updated contrib/pngminim project to work with the new pnglibconf.h
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/pngerror.c b/pngerror.c
index 8e0569e..f6762b1 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -184,8 +184,9 @@
buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0';
}
}
+#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */
-#ifdef PNG_READ_SUPPORTED
+#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
void PNGAPI
png_chunk_error(png_structp png_ptr, png_const_charp error_message)
{
@@ -198,8 +199,7 @@
png_error(png_ptr, msg);
}
}
-#endif /* PNG_READ_SUPPORTED */
-#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */
+#endif /* PNG_READ_SUPPORTED && PNG_ERROR_TEXT_SUPPORTED */
#ifdef PNG_WARNINGS_SUPPORTED
void PNGAPI