diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-07-11 15:32:51 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-07-12 20:42:29 +0300 |
commit | 6282b28b6fe218390b843a8a71bb5cc2b63dd05c (patch) | |
tree | 5c45fe4caad2571494d6d237b76c8eced84e0d2b /include/mbgl/util | |
parent | d918f8d7c2e9eb4e3514078da6621c159e67069c (diff) | |
download | qtlocation-mapboxgl-6282b28b6fe218390b843a8a71bb5cc2b63dd05c.tar.gz |
[core] Added MBGL_CONSTEXPR to satisfy GCC 4.9
Diffstat (limited to 'include/mbgl/util')
-rw-r--r-- | include/mbgl/util/convert.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/util/util.hpp | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/mbgl/util/convert.hpp b/include/mbgl/util/convert.hpp index c2b3d9950d..bedb1a4a08 100644 --- a/include/mbgl/util/convert.hpp +++ b/include/mbgl/util/convert.hpp @@ -1,3 +1,5 @@ +#include <mbgl/util/util.hpp> + #include <array> #include <type_traits> #include <utility> @@ -7,7 +9,7 @@ namespace util { template<typename To, typename From, std::size_t Size, typename = std::enable_if_t<std::is_convertible<From, To>::value>> -constexpr std::array<To, Size> convert(const std::array<From, Size>&from) { +MBGL_CONSTEXPR std::array<To, Size> convert(const std::array<From, Size>&from) { std::array<To, Size> to {}; std::copy(std::begin(from), std::end(from), std::begin(to)); return to; diff --git a/include/mbgl/util/util.hpp b/include/mbgl/util/util.hpp index c5a7cb3780..7960b40299 100644 --- a/include/mbgl/util/util.hpp +++ b/include/mbgl/util/util.hpp @@ -12,3 +12,10 @@ #define MBGL_VERIFY_THREAD(tid) #endif + +// GCC 4.9 compatibility +#if !defined(__GNUC__) || __GNUC__ >= 5 +#define MBGL_CONSTEXPR constexpr +#else +#define MBGL_CONSTEXPR inline +#endif |