diff --git a/src/Magnum/Animation/Player.h b/src/Magnum/Animation/Player.h index a7d767619..a5af4aac6 100644 --- a/src/Magnum/Animation/Player.h +++ b/src/Magnum/Animation/Player.h @@ -387,24 +387,23 @@ template Player& add(const Track& track, R& destination) { return add(TrackView{track}, destination); } #else /* MSVC 2015 and 2017 is clueless when it comes to trying to deduce the template parameters (C2893: Failed to specialize function template). - MSVC 2019 works with /permissive-, but I can neither detect presence - of the flag nor force it onto users, so I'm treating it the same. - It works when calling add explicitly, but that makes the API - hard to use and inconsistent between platforms. The only possible - workaround is to make add() take *anything*, casting it to proper - TrackView type and then calling add() with explicit template - parameters. This also neatly resolves the Track/TrackView overload, - as the static_cast is either a no-op or it invokes the conversion - operator on Track. The original code also reportedly makes the - Intellisense freezing like hell and adding this overload fixes the - freezes. Three birds with one stone. */ + MSVC 2019+ works with /permissive-. It works when calling add + explicitly, but that makes the API hard to use and inconsistent + between platforms. The only possible workaround is to make add() + take *anything*, casting it to proper TrackView type and then + calling add() with explicit template parameters. This also neatly + resolves the Track/TrackView overload, as the static_cast is either + a no-op or it invokes the conversion operator on Track. The original + code also reportedly makes the Intellisense freezing like hell and + adding this overload fixes the freezes. Three birds with one + stone. */ template Player& add(const Track& track, R& destination) { return add(static_cast&>(track), destination); } @@ -448,7 +447,7 @@ template Player& addWithCallback(const Track& track, void(*callback)(K, const R&, void*), void* userData = nullptr); - #elif !defined(CORRADE_MSVC2019_COMPATIBILITY) /* See above why */ + #elif !defined(CORRADE_MSVC_COMPATIBILITY) /* See above why */ template Player& addWithCallback(const Track& track, Callback callback, void* userData = nullptr) { return addWithCallback(TrackView{track}, callback, userData); } @@ -487,7 +486,7 @@ template Player& addWithCallback(const Track& track, void(*callback)(K, const R&, U&), U& userData); - #elif !defined(CORRADE_MSVC2019_COMPATIBILITY) /* See above why */ + #elif !defined(CORRADE_MSVC_COMPATIBILITY) /* See above why */ template Player& addWithCallback(const Track& track, Callback callback, U& userData) { return addWithCallback(TrackView{track}, callback, userData); } @@ -532,7 +531,7 @@ template Player& addWithCallbackOnChange(const Track& track, void(*callback)(K, const R&, void*), R& destination, void* userData = nullptr); - #elif !defined(CORRADE_MSVC2019_COMPATIBILITY) /* See above why */ + #elif !defined(CORRADE_MSVC_COMPATIBILITY) /* See above why */ template Player& addWithCallbackOnChange(const Track& track, Callback callback, R& destination, void* userData = nullptr) { return addWithCallbackOnChange(TrackView{track}, callback, destination, userData); } @@ -571,7 +570,7 @@ template Player& addWithCallbackOnChange(const Track& track, void(*callback)(K, const R&, void*), R& destination, U& userData); - #elif !defined(CORRADE_MSVC2019_COMPATIBILITY) /* See above why */ + #elif !defined(CORRADE_MSVC_COMPATIBILITY) /* See above why */ template Player& addWithCallbackOnChange(const Track& track, Callback callback, R& destination, U& userData) { return addWithCallbackOnChange(TrackView{track}, callback, destination, userData); } @@ -623,7 +622,7 @@ template Player& addRawCallback(const Track& track, void(*callback)(const TrackViewStorage&, K, std::size_t&, void*, void(*)(), void*), void* destination, void(*userCallback)(), void* userData); - #elif !defined(CORRADE_MSVC2019_COMPATIBILITY) /* See above why */ + #elif !defined(CORRADE_MSVC_COMPATIBILITY) /* See above why */ template Player& addRawCallback(const Track& track, Callback callback, void* destination, void(*userCallback)(), void* userData) { return addRawCallback(TrackView{track}, callback, destination, userCallback, userData); } diff --git a/src/Magnum/MeshTools/GenerateNormals.cpp b/src/Magnum/MeshTools/GenerateNormals.cpp index 214300d50..186221bea 100644 --- a/src/Magnum/MeshTools/GenerateNormals.cpp +++ b/src/Magnum/MeshTools/GenerateNormals.cpp @@ -90,7 +90,7 @@ std::pair, std::vector> generateFlatNormals(co namespace { -#if defined(CORRADE_MSVC2019_COMPATIBILITY) && !defined(CORRADE_MSVC2017_COMPATIBILITY) +#if defined(CORRADE_TARGET_MSVC) && !defined(CORRADE_MSVC_COMPATIBILITY) && _MSC_VER >= 1920 && _MSC_VER < 1930 /* When using /permissive- with MSVC2019, using namespace inside the function below FOR SOME REASON gets lost when instantiating the template. That's stupid but what can we do -- the only way to work around that is to move it