[windows, qt] fix windows compiler errors, remove tao + tuple polyfill
This commit is contained in:
@@ -694,7 +694,6 @@ include/mbgl/util/thread.hpp
|
||||
include/mbgl/util/tileset.hpp
|
||||
include/mbgl/util/timer.hpp
|
||||
include/mbgl/util/traits.hpp
|
||||
include/mbgl/util/tuple.hpp
|
||||
include/mbgl/util/type_list.hpp
|
||||
include/mbgl/util/unitbezier.hpp
|
||||
include/mbgl/util/util.hpp
|
||||
|
||||
@@ -49,7 +49,6 @@ elseif(MBGL_PLATFORM STREQUAL "macos")
|
||||
endif()
|
||||
elseif(MBGL_PLATFORM STREQUAL "qt")
|
||||
mason_use(optional VERSION f27e7908 HEADER_ONLY)
|
||||
mason_use(tao_tuple VERSION 28626e99 HEADER_ONLY)
|
||||
|
||||
if(NOT WITH_QT_DECODERS)
|
||||
mason_use(libjpeg-turbo VERSION 1.5.0)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/type_list.hpp>
|
||||
#include <mbgl/util/tuple.hpp>
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
namespace mbgl {
|
||||
@@ -24,22 +24,22 @@ template <class...> class IndexedTuple;
|
||||
// for motivation.
|
||||
//
|
||||
template <class... Is, class... Ts>
|
||||
class IndexedTuple<TypeList<Is...>, TypeList<Ts...>> : public tuple_polyfill<Ts...> {
|
||||
class IndexedTuple<TypeList<Is...>, TypeList<Ts...>> : public std::tuple<Ts...> {
|
||||
public:
|
||||
static_assert(sizeof...(Is) == sizeof...(Ts), "IndexedTuple size mismatch");
|
||||
|
||||
template <class I>
|
||||
auto& get() {
|
||||
return get_polyfill<TypeIndex<I, Is...>::value>(*this);
|
||||
return std::get<TypeIndex<I, Is...>::value, Ts...>(*this);
|
||||
}
|
||||
|
||||
template <class I>
|
||||
const auto& get() const {
|
||||
return get_polyfill<TypeIndex<I, Is...>::value>(*this);
|
||||
return std::get<TypeIndex<I, Is...>::value, Ts...>(*this);
|
||||
}
|
||||
|
||||
template <class... Us>
|
||||
IndexedTuple(Us&&... other) : tuple_polyfill<Ts...>(std::forward<Us>(other)...) {}
|
||||
IndexedTuple(Us&&... other) : std::tuple<Ts...>(std::forward<Us>(other)...) {};
|
||||
|
||||
template <class... Js, class... Us>
|
||||
IndexedTuple<TypeList<Is..., Js...>, TypeList<Ts..., Us...>>
|
||||
@@ -49,6 +49,15 @@ public:
|
||||
other.template get<Js>()...
|
||||
};
|
||||
}
|
||||
|
||||
// Help out MSVC++
|
||||
bool operator==(const IndexedTuple<TypeList<Is...>, TypeList<Ts...>>& other) const {
|
||||
return static_cast<const std::tuple<Ts...>&>(*this) == static_cast<const std::tuple<Ts...>&>(other);
|
||||
}
|
||||
|
||||
bool operator!=(const IndexedTuple<TypeList<Is...>, TypeList<Ts...>>& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
};
|
||||
|
||||
template <class, class T>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Polyfill needed by Windows because MSVC STL
|
||||
// is not compatible with our IndexedTuple code
|
||||
#if defined(_WINDOWS)
|
||||
|
||||
#include <tao/tuple/tuple.hpp>
|
||||
|
||||
#define get_polyfill tao::get
|
||||
#define tuple_polyfill tao::tuple
|
||||
|
||||
#else
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#define get_polyfill std::get
|
||||
#define tuple_polyfill std::tuple
|
||||
|
||||
#endif
|
||||
@@ -40,6 +40,7 @@
|
||||
"render-tests/fill-extrusion-pattern/literal": "https://github.com/mapbox/mapbox-gl-js/issues/3327",
|
||||
"render-tests/fill-extrusion-pattern/missing": "https://github.com/mapbox/mapbox-gl-js/issues/3327",
|
||||
"render-tests/fill-extrusion-pattern/opacity": "https://github.com/mapbox/mapbox-gl-js/issues/3327",
|
||||
"render-tests/fill-extrusion-pattern/feature-expression": "https://github.com/mapbox/mapbox-gl-js/issues/3327",
|
||||
"render-tests/fill-pattern/update-feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
|
||||
"render-tests/geojson/inline-linestring-fill": "current behavior is arbitrary",
|
||||
"render-tests/geojson/inline-polygon-symbol": "behavior needs reconciliation with gl-js",
|
||||
|
||||
@@ -40,7 +40,6 @@ macro(mbgl_platform_core)
|
||||
|
||||
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_add_mason_package(mbgl-core PRIVATE optional)
|
||||
target_add_mason_package(mbgl-core PRIVATE tao_tuple)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -56,7 +55,6 @@ macro(mbgl_filesource)
|
||||
|
||||
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_add_mason_package(mbgl-filesource PRIVATE optional)
|
||||
target_add_mason_package(mbgl-filesource PRIVATE tao_tuple)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
@@ -160,7 +160,6 @@ elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
)
|
||||
|
||||
target_add_mason_package(qmapboxgl PRIVATE optional)
|
||||
target_add_mason_package(qmapboxgl PRIVATE tao_tuple)
|
||||
elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "QNX")
|
||||
list(APPEND MBGL_QT_CORE_FILES
|
||||
PRIVATE platform/qt/src/thread.cpp
|
||||
|
||||
Reference in New Issue
Block a user