diff --git a/CMakeLists.txt b/CMakeLists.txt index 6358976e6..91e729409 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,8 +40,8 @@ if(IS_CI_BUILD) add_compile_options(-DCI_BUILD=1) endif() -mason_use(geometry VERSION 0.8.0 HEADER_ONLY) -mason_use(variant VERSION 1.1.0 HEADER_ONLY) +mason_use(geometry VERSION 0.9.0 HEADER_ONLY) +mason_use(variant VERSION 1.1.4 HEADER_ONLY) mason_use(unique_resource VERSION dev HEADER_ONLY) mason_use(rapidjson VERSION 1.1.0 HEADER_ONLY) mason_use(boost VERSION 1.60.0 HEADER_ONLY) @@ -51,7 +51,7 @@ mason_use(kdbush VERSION 0.1.1 HEADER_ONLY) mason_use(earcut VERSION 0.12.1 HEADER_ONLY) mason_use(protozero VERSION 1.4.2 HEADER_ONLY) mason_use(pixelmatch VERSION 0.10.0 HEADER_ONLY) -mason_use(geojson VERSION 0.3.2 HEADER_ONLY) +mason_use(geojson VERSION 0.4.0 HEADER_ONLY) mason_use(icu VERSION 58.1) if(WITH_COVERAGE) diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm index 392a6d7f5..25a2945cf 100644 --- a/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -72,7 +72,7 @@ NSNumber *number = (NSNumber *)value; if ((strcmp([number objCType], @encode(char)) == 0) || (strcmp([number objCType], @encode(BOOL)) == 0)) { - return mbglValue.get(); + return uint64_t(mbglValue.get()); } else if ( strcmp([number objCType], @encode(double)) == 0 || strcmp([number objCType], @encode(float)) == 0) { return mbglValue.get(); diff --git a/platform/darwin/test/MGLFeatureTests.mm b/platform/darwin/test/MGLFeatureTests.mm index 7f464aaab..66b752a73 100644 --- a/platform/darwin/test/MGLFeatureTests.mm +++ b/platform/darwin/test/MGLFeatureTests.mm @@ -91,7 +91,7 @@ mbgl::Point point = { -90.066667, 29.95 }; mbgl::Feature pointFeature { point }; pointFeature.id = { UINT64_MAX }; - pointFeature.properties["null"] = nullptr; + pointFeature.properties["null"] = mapbox::geometry::null_value; pointFeature.properties["bool"] = true; pointFeature.properties["unsigned int"] = UINT64_MAX; pointFeature.properties["int"] = INT64_MIN; diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index f602f79d6..1ee1eed22 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -82,6 +82,8 @@ endmacro() macro(mbgl_platform_render) + set_xcode_property(mbgl-render GCC_SYMBOLS_PRIVATE_EXTERN YES) + target_link_libraries(mbgl-render PRIVATE mbgl-loop PRIVATE "-framework Foundation" @@ -95,6 +97,8 @@ endmacro() macro(mbgl_platform_offline) + set_xcode_property(mbgl-offline GCC_SYMBOLS_PRIVATE_EXTERN YES) + target_link_libraries(mbgl-offline PRIVATE mbgl-loop PRIVATE "-framework Foundation" @@ -108,6 +112,8 @@ endmacro() macro(mbgl_platform_test) + set_xcode_property(mbgl-test GCC_SYMBOLS_PRIVATE_EXTERN YES) + target_sources(mbgl-test PRIVATE test/src/main.cpp ) @@ -130,6 +136,8 @@ macro(mbgl_platform_test) endmacro() macro(mbgl_platform_benchmark) + set_xcode_property(mbgl-benchmark GCC_SYMBOLS_PRIVATE_EXTERN YES) + target_sources(mbgl-benchmark PRIVATE benchmark/src/main.cpp ) @@ -152,6 +160,8 @@ macro(mbgl_platform_benchmark) endmacro() macro(mbgl_platform_node) + set_xcode_property(mbgl-node GCC_SYMBOLS_PRIVATE_EXTERN YES) + target_link_libraries(mbgl-node PRIVATE "-framework Foundation" PRIVATE "-framework OpenGL" diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 8528ed0be..b38883e91 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -1461,6 +1461,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; HEADER_SEARCH_PATHS = ( "$(mbgl_core_INCLUDE_DIRECTORIES)", "$(mbgl_loop_INCLUDE_DIRECTORIES)", diff --git a/platform/qt/src/qt_conversion.hpp b/platform/qt/src/qt_conversion.hpp index acb7ed7d5..e49b6dbe3 100644 --- a/platform/qt/src/qt_conversion.hpp +++ b/platform/qt/src/qt_conversion.hpp @@ -94,9 +94,9 @@ inline optional toValue(const QVariant& value) { } else if (value.type() == QVariant::Color) { return { value.value().name().toStdString() }; } else if (value.type() == QVariant::Int) { - return { value.toInt() }; + return { int64_t(value.toInt()) }; } else if (value.canConvert(QVariant::Double)) { - return { value.toFloat() }; + return { value.toDouble() }; } else { return {}; } diff --git a/src/mbgl/annotation/annotation_tile.hpp b/src/mbgl/annotation/annotation_tile.hpp index d43ec82d3..bf7307599 100644 --- a/src/mbgl/annotation/annotation_tile.hpp +++ b/src/mbgl/annotation/annotation_tile.hpp @@ -31,7 +31,7 @@ public: FeatureType getType() const override { return type; } optional getValue(const std::string&) const override; - optional getID() const override { return { id }; } + optional getID() const override { return { static_cast(id) }; } GeometryCollection getGeometries() const override { return geometries; } const AnnotationID id; diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 3b8758f98..8577002c0 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -825,7 +825,8 @@ AnnotationIDs Map::queryPointAnnotations(const ScreenBox& box) { std::set set; for (auto &feature : features) { assert(feature.id); - assert(*feature.id <= std::numeric_limits::max()); + assert(feature.id->is()); + assert(feature.id->get() <= std::numeric_limits::max()); set.insert(static_cast(feature.id->get())); } AnnotationIDs ids; diff --git a/test/api/annotations.test.cpp b/test/api/annotations.test.cpp index a56992bc2..31277718d 100644 --- a/test/api/annotations.test.cpp +++ b/test/api/annotations.test.cpp @@ -340,12 +340,12 @@ TEST(Annotations, QueryRenderedFeatures) { auto features = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 0, 0 })); EXPECT_EQ(features.size(), 1u); EXPECT_TRUE(!!features[0].id); - EXPECT_EQ(*features[0].id, 0); + EXPECT_EQ(*features[0].id, uint64_t(0)); auto features2 = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 50, 0 })); EXPECT_EQ(features2.size(), 1u); EXPECT_TRUE(!!features2[0].id); - EXPECT_EQ(*features2[0].id, 1); + EXPECT_EQ(*features2[0].id, uint64_t(1)); } TEST(Annotations, QueryFractionalZoomLevels) { diff --git a/test/src/mbgl/test/conversion_stubs.hpp b/test/src/mbgl/test/conversion_stubs.hpp index b80a2c98b..ddffb1e3b 100644 --- a/test/src/mbgl/test/conversion_stubs.hpp +++ b/test/src/mbgl/test/conversion_stubs.hpp @@ -104,7 +104,7 @@ inline optional toValue(const Value& value) { } else if (value.is()) { return { value.get() }; } else if (value.is()) { - return { value.get() }; + return { double(value.get()) }; } else { return {}; } diff --git a/test/style/conversion/geojson_options.test.cpp b/test/style/conversion/geojson_options.test.cpp index dc9be237a..14a7adbba 100644 --- a/test/style/conversion/geojson_options.test.cpp +++ b/test/style/conversion/geojson_options.test.cpp @@ -17,7 +17,7 @@ TEST(GeoJSONOptions, Basic) { } TEST(GeoJSONOptions, ErrorHandling) { - ValueMap map {{"maxzoom", "should not be a string"}}; + ValueMap map {{"maxzoom", std::string{"should not be a string"}}}; Value raw(map); Result converted = convert(raw); ASSERT_FALSE((bool) converted); @@ -44,14 +44,14 @@ TEST(GeoJSONOptions, RetainsDefaults) { TEST(GeoJSONOptions, FullConversion) { ValueMap map { //GeoJSON-VT - {"maxzoom", 1}, - {"buffer", 2}, - {"tolerance", 3}, + {"maxzoom", 1.0f}, + {"buffer", 2.0f}, + {"tolerance", 3.0f}, //Supercluster {"cluster", true}, - {"clusterRadius", 4}, - {"clusterMaxZoom", 5} + {"clusterRadius", 4.0f}, + {"clusterMaxZoom", 5.0f} }; Value raw(map); GeoJSONOptions converted = *convert(raw); diff --git a/test/style/filter.test.cpp b/test/style/filter.test.cpp index b49f424a3..33b64978f 100644 --- a/test/style/filter.test.cpp +++ b/test/style/filter.test.cpp @@ -42,7 +42,7 @@ TEST(Filter, EqualsNumber) { ASSERT_FALSE(f(feature({{ "foo", std::string("0") }}))); ASSERT_FALSE(f(feature({{ "foo", false }}))); ASSERT_FALSE(f(feature({{ "foo", true }}))); - ASSERT_FALSE(f(feature({{ "foo", nullptr }}))); + ASSERT_FALSE(f(feature({{ "foo", mapbox::geometry::null_value }}))); ASSERT_FALSE(f(feature({{}}))); } @@ -113,13 +113,13 @@ TEST(Filter, NotHas) { TEST(Filter, ID) { Feature feature1 { Point() }; - feature1.id = { 1234 }; + feature1.id = { uint64_t(1234) }; ASSERT_TRUE(parse("[\"==\", \"$id\", 1234]")(feature1)); ASSERT_FALSE(parse("[\"==\", \"$id\", \"1234\"]")(feature1)); Feature feature2 { Point() }; - feature2.properties["id"] = { 1234 }; + feature2.properties["id"] = { uint64_t(1234) }; ASSERT_FALSE(parse("[\"==\", \"$id\", 1234]")(feature2)); }