diff options
author | artemp <artem@mapnik.org> | 2014-11-13 15:46:11 +0000 |
---|---|---|
committer | artemp <artem@mapnik.org> | 2014-11-13 15:46:11 +0000 |
commit | 782a0be4bf307877f960983346b16628899e38a3 (patch) | |
tree | a7693fd95fdd5bc17800972addb6557b628ba33d /platform/default/image.cpp | |
parent | 9fd9ced95647a721e9c2f7f539ce9dfac3356f43 (diff) | |
parent | 27cf24171a014b63e139e7fc77422753beac44e1 (diff) | |
download | qtlocation-mapboxgl-782a0be4bf307877f960983346b16628899e38a3.tar.gz |
Merge branch 'master' into image-readers
Diffstat (limited to 'platform/default/image.cpp')
-rw-r--r-- | platform/default/image.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/default/image.cpp b/platform/default/image.cpp index 397a6b1928..96d01ab718 100644 --- a/platform/default/image.cpp +++ b/platform/default/image.cpp @@ -1,4 +1,5 @@ #include <mbgl/util/image.hpp> +#include <mbgl/util/string.hpp> #include <png.h> @@ -8,6 +9,19 @@ #include <cstring> #include <mbgl/util/image_reader.hpp> +// Check png library version. +const static bool png_version_check = []() { + const png_uint_32 version = png_access_version_number(); + if (version != PNG_LIBPNG_VER) { + throw std::runtime_error(mbgl::util::sprintf<96>( + "libpng version mismatch: headers report %d.%d.%d, but library reports %d.%d.%d", + PNG_LIBPNG_VER / 10000, (PNG_LIBPNG_VER / 100) % 100, PNG_LIBPNG_VER % 100, + version / 10000, (version / 100) % 100, version % 100)); + } + return true; +}(); + + namespace mbgl { namespace util { |