diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2017-03-14 10:49:00 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-03-14 11:18:55 +0200 |
commit | a0da2fb5d1da6ba232de87e62f6b97d291e2a4b5 (patch) | |
tree | 1931150140f0d17bf8e029f0a4356e627e207a81 | |
parent | bce352bd86f7faf98b3ba5bbb31d3a7860533199 (diff) | |
download | qtlocation-mapboxgl-a0da2fb5d1da6ba232de87e62f6b97d291e2a4b5.tar.gz |
[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.
-rw-r--r-- | src/mbgl/util/compression.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mbgl/util/compression.cpp b/src/mbgl/util/compression.cpp index 18cb189d02..832c38b8d5 100644 --- a/src/mbgl/util/compression.cpp +++ b/src/mbgl/util/compression.cpp @@ -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)); |