From fe3160ca996922e122f2aa629280f51ad9445ae3 Mon Sep 17 00:00:00 2001 From: Mathis Logemann Date: Fri, 20 Nov 2020 20:02:40 +0100 Subject: [PATCH] fix mscv compiler errors --- include/mapnik/config.hpp | 11 +++++++++++ include/mapnik/geometry.hpp | 3 ++- include/mapnik/json/geojson_grammar_x3.hpp | 3 ++- include/mapnik/json/json_value.hpp | 3 ++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/mapnik/config.hpp b/include/mapnik/config.hpp index ac48546f2..65b370784 100644 --- a/include/mapnik/config.hpp +++ b/include/mapnik/config.hpp @@ -50,6 +50,17 @@ # endif #endif +#if defined(__clang__) +#if __has_feature(cxx_inheriting_constructors) +#define MAPNIK_USE_INHERITING_CONSTRUCTORS 1 +#endif +#elif (defined(__GNUC__) && \ + (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 8)) || \ + (__cpp_inheriting_constructors >= 200802) || \ + (defined(_MSC_VER) && _MSC_VER >= 1910) +#define MAPNIK_USE_INHERITING_CONSTRUCTORS 1 +#endif + #define PROJ_ENVELOPE_POINTS 20 #endif // MAPNIK_CONFIG_HPP diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index f6e795de9..dccd25371 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -24,6 +24,7 @@ #define MAPNIK_GEOMETRY_HPP // mapnik +#include #include #include #include @@ -59,7 +60,7 @@ struct geometry : geometry_base { using coordinate_type = T; -#if __cpp_inheriting_constructors >= 200802 +#if MAPNIK_USE_INHERITING_CONSTRUCTORS using geometry_base::geometry_base; diff --git a/include/mapnik/json/geojson_grammar_x3.hpp b/include/mapnik/json/geojson_grammar_x3.hpp index 3f44d1066..e840c3436 100644 --- a/include/mapnik/json/geojson_grammar_x3.hpp +++ b/include/mapnik/json/geojson_grammar_x3.hpp @@ -23,6 +23,7 @@ #ifndef MAPNIK_JSON_GEOJSON_GRAMMAR_X3_HPP #define MAPNIK_JSON_GEOJSON_GRAMMAR_X3_HPP +#include #include #include #include @@ -54,7 +55,7 @@ using geojson_value_base = mapnik::util::variant; struct geojson_value : geojson_value_base { -#if __cpp_inheriting_constructors >= 200802 +#if MAPNIK_USE_INHERITING_CONSTRUCTORS using geojson_value_base::geojson_value_base; diff --git a/include/mapnik/json/json_value.hpp b/include/mapnik/json/json_value.hpp index c5ed03604..2157ce595 100644 --- a/include/mapnik/json/json_value.hpp +++ b/include/mapnik/json/json_value.hpp @@ -24,6 +24,7 @@ #define MAPNIK_JSON_JSON_VALUE_HPP // mapnik +#include #include #include // stl @@ -46,7 +47,7 @@ using json_value_base = mapnik::util::variant; struct json_value : json_value_base { -#if __cpp_inheriting_constructors >= 200802 +#if MAPNIK_USE_INHERITING_CONSTRUCTORS using json_value_base::json_value_base;