[libzomg] Fix build with libpng versions older than 1.5.0.
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Thu, 10 Sep 2015 02:21:37 +0000 (22:21 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Thu, 10 Sep 2015 02:21:37 +0000 (22:21 -0400)
commita1be0abac37afeb0330aca7912d906c611702a0f
tree436596f4fdeb4a2c0fe9e2e8af9b53923e590693
parent6c9fc346e119e921e440a14d70ec142bc606f842
[libzomg] Fix build with libpng versions older than 1.5.0.

Debian-based distributions still ship with libpng-1.2, so we need
to maintain compatibility. The biggest change in libpng-1.5.0 was
the constification of pointer arguments. To work around this,
we'll cast the pointers to non-const when compiling with older
versions of libpng.

libpng doesn't actually modify the contents of the data, so it's
effectively const anyway.

Also, libpng-1.4.0 changed the definition of png_uint_32 to
unsigned int. Previously, it was unsigned long, which is the same
as unsigned int on most 32-bit systems, but is 64-bit on most
64-bit systems (other than Windows).
src/libzomg/Metadata.hpp
src/libzomg/PngReader.cpp
src/libzomg/PngWriter.cpp