From 07ad29d30da44ded2bf40418b3625fecfb817399 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 14 May 2018 16:44:43 +0300 Subject: [PATCH] [qt] Fix build when building the Qt Location plugin - MinGW has to explicitly know that is building a static library. - Android doesn't have 'round' on the std:: namespace when using g++. --- platform/qt/include/qmapbox.hpp | 10 +++++++--- src/mbgl/style/expression/compound_expression.cpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/qt/include/qmapbox.hpp b/platform/qt/include/qmapbox.hpp index 369890343..1ab04403c 100644 --- a/platform/qt/include/qmapbox.hpp +++ b/platform/qt/include/qmapbox.hpp @@ -9,10 +9,14 @@ // This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style -#if defined(QT_BUILD_MAPBOXGL_LIB) - #define Q_MAPBOXGL_EXPORT Q_DECL_EXPORT +#if !defined(QT_MAPBOXGL_STATIC) +# if defined(QT_BUILD_MAPBOXGL_LIB) +# define Q_MAPBOXGL_EXPORT Q_DECL_EXPORT +# else +# define Q_MAPBOXGL_EXPORT Q_DECL_IMPORT +# endif #else - #define Q_MAPBOXGL_EXPORT Q_DECL_IMPORT +# define Q_MAPBOXGL_EXPORT #endif namespace QMapbox { diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp index c257dbf2b..bcde09e1b 100644 --- a/src/mbgl/style/expression/compound_expression.cpp +++ b/src/mbgl/style/expression/compound_expression.cpp @@ -364,7 +364,7 @@ std::unordered_map initiali return result; }); - define("round", [](double x) -> Result { return std::round(x); }); + define("round", [](double x) -> Result { return ::round(x); }); define("floor", [](double x) -> Result { return std::floor(x); }); define("ceil", [](double x) -> Result { return std::ceil(x); }); define("abs", [](double x) -> Result { return std::abs(x); });