From 2cdbe934c2df8e4efbadbda5d20eac0d59d24b05 Mon Sep 17 00:00:00 2001 From: Molly Lloyd Date: Wed, 22 Aug 2018 10:57:02 -0700 Subject: [windows, qt] fix windows compiler errors, remove tao + tuple polyfill --- cmake/core-files.txt | 1 - cmake/mason-dependencies.cmake | 1 - include/mbgl/util/indexed_tuple.hpp | 19 ++++++++++++++----- include/mbgl/util/tuple.hpp | 19 ------------------- platform/node/test/ignores.json | 1 + platform/qt/config.cmake | 2 -- platform/qt/qt.cmake | 1 - 7 files changed, 15 insertions(+), 29 deletions(-) delete mode 100644 include/mbgl/util/tuple.hpp diff --git a/cmake/core-files.txt b/cmake/core-files.txt index a1e43d2357..d2bc0b96d8 100644 --- a/cmake/core-files.txt +++ b/cmake/core-files.txt @@ -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 diff --git a/cmake/mason-dependencies.cmake b/cmake/mason-dependencies.cmake index 4a886bef21..f869fe2fdc 100644 --- a/cmake/mason-dependencies.cmake +++ b/cmake/mason-dependencies.cmake @@ -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) diff --git a/include/mbgl/util/indexed_tuple.hpp b/include/mbgl/util/indexed_tuple.hpp index d1a9e226b1..99d73d1e19 100644 --- a/include/mbgl/util/indexed_tuple.hpp +++ b/include/mbgl/util/indexed_tuple.hpp @@ -1,8 +1,8 @@ #pragma once #include -#include +#include #include namespace mbgl { @@ -24,22 +24,22 @@ template class IndexedTuple; // for motivation. // template -class IndexedTuple, TypeList> : public tuple_polyfill { +class IndexedTuple, TypeList> : public std::tuple { public: static_assert(sizeof...(Is) == sizeof...(Ts), "IndexedTuple size mismatch"); template auto& get() { - return get_polyfill::value>(*this); + return std::get::value, Ts...>(*this); } template const auto& get() const { - return get_polyfill::value>(*this); + return std::get::value, Ts...>(*this); } template - IndexedTuple(Us&&... other) : tuple_polyfill(std::forward(other)...) {} + IndexedTuple(Us&&... other) : std::tuple(std::forward(other)...) {}; template IndexedTuple, TypeList> @@ -49,6 +49,15 @@ public: other.template get()... }; } + + // Help out MSVC++ + bool operator==(const IndexedTuple, TypeList>& other) const { + return static_cast&>(*this) == static_cast&>(other); + } + + bool operator!=(const IndexedTuple, TypeList>& other) const { + return !(*this == other); + } }; template diff --git a/include/mbgl/util/tuple.hpp b/include/mbgl/util/tuple.hpp deleted file mode 100644 index 3f6e80a8c7..0000000000 --- a/include/mbgl/util/tuple.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -// Polyfill needed by Windows because MSVC STL -// is not compatible with our IndexedTuple code -#if defined(_WINDOWS) - -#include - -#define get_polyfill tao::get -#define tuple_polyfill tao::tuple - -#else - -#include - -#define get_polyfill std::get -#define tuple_polyfill std::tuple - -#endif diff --git a/platform/node/test/ignores.json b/platform/node/test/ignores.json index fcc9d88c88..fe6ead7722 100644 --- a/platform/node/test/ignores.json +++ b/platform/node/test/ignores.json @@ -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", diff --git a/platform/qt/config.cmake b/platform/qt/config.cmake index 785b3cd76a..5cb622f813 100644 --- a/platform/qt/config.cmake +++ b/platform/qt/config.cmake @@ -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() diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 341c0db45b..323c616a64 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -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 -- cgit v1.2.1