Merge branch 'master' into image-readers
This commit is contained in:
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user