From a0da2fb5d1da6ba232de87e62f6b97d291e2a4b5 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Tue, 14 Mar 2017 10:49:00 +0200 Subject: [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. --- src/mbgl/util/compression.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mbgl/util') 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)); -- cgit v1.2.1