summaryrefslogtreecommitdiff
path: root/pngpriv.h
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2013-05-08 14:35:21 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2013-05-08 14:35:21 -0500
commit122bec17f21fa84cdaccb30b4eed754f05afa349 (patch)
treed33f672907ffaad0dd31b814ad04882e7bbba324 /pngpriv.h
parent9afb90f88504a158222df08cb515136bfc0b0a79 (diff)
downloadlibpng-122bec17f21fa84cdaccb30b4eed754f05afa349.tar.gz
[libpng16]Check ZLIB_VERNUM for mismatches, enclose #error in quotes
Diffstat (limited to 'pngpriv.h')
-rw-r--r--pngpriv.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/pngpriv.h b/pngpriv.h
index d06284d1e..fcfea42fb 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -694,6 +694,24 @@
#include "pngstruct.h"
#include "pnginfo.h"
+/* Validate the include paths - the include path used to generate pnglibconf.h
+ * must match that used in the build, or we must be using pnglibconf.h.prebuilt:
+ */
+#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
+# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
+ "-I (include path) error: see the notes in pngpriv.h"
+ /* This means that when pnglibconf.h was built the copy of zlib.h that it
+ * used is not the same as the one being used here. Because the build of
+ * libpng makes decisions to use inflateInit2 and inflateReset2 based on the
+ * zlib version number and because this affects handling of certain broken
+ * PNG files the -I directives must match.
+ *
+ * The most likely explanation is that you passed a -I in CFLAGS, this will
+ * not work; all the preprocessor directories and in particular all the -I
+ * directives must be in CPPFLAGS.
+ */
+#endif
+
/* This is used for 16 bit gamma tables -- only the top level pointers are
* const; this could be changed:
*/