  #endif
 
 -#include "zlib.h"   /* For crc32 */
-+#if defined MACOSX
++#if defined MACOSX || defined IOS
 +#include "zlib.h"
 +#else
 +#include <external/zlib/zlib.h>

  * of files at once by typing "pngtest -m file1.png file2.png ..."
  */

+#if defined MACOSX
 #include "zlib.h"
+#else
+#include <external/zlib/zlib.h>

+#endif /* PNGLCONF_H */
--- misc/libpng-1.5.1/pngstruct.h	2011-02-03 05:58:17.000000000 +0100
+++ misc/build/libpng-1.5.1/pngstruct.h	2011-03-24 21:47:23.380397048 +0100
@@ -24,7 +24,15 @@
  * in this structure and is required for decompressing the LZ compressed
  * data in PNG files.
  */
+/* WTF, surely this should depend explicitly on whether using the system or
+ * internal zlib, not on OS... But yeah, so maybe MacOSX (and iOS) are the only OSes for which
+ * we use a system zlib but internal libpng, at least by default.
+ */
+#if defined MACOSX || defined IOS
 #include "zlib.h"
+#else
+#include <external/zlib/zlib.h>
+#endif
 
 struct png_struct_def
 {
--- misc/libpng-1.5.1/pngtest.c	2011-02-03 05:58:17.000000000 +0100
