[build] Fix build when using a Z_PREFIX zlib

It will redefine mbgl::util::compress to mbgl::util::z_compress and
cause a link error. Aka pre-processor hell.
This commit is contained in:
Thiago Marcos P. Santos
2017-03-14 10:49:00 +02:00
committed by Thiago Marcos P. Santos
parent bce352bd86
commit a0da2fb5d1

View File

@@ -22,6 +22,11 @@ const static bool zlibVersionCheck __attribute__((unused)) = []() {
namespace mbgl {
namespace util {
// Needed when using a zlib compiled with -DZ_PREFIX
// because it will mess with this function name and
// cause a link error.
#undef z_compress
std::string compress(const std::string &raw) {
z_stream deflate_stream;
memset(&deflate_stream, 0, sizeof(deflate_stream));