Skip to content

Commit

Permalink
fix MSVC 19.40 build crashing, fix clangd warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanfer committed Jun 14, 2024
1 parent b65022e commit 567761e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0)
add_compile_definitions(NOMINMAX)
add_compile_definitions(WIN32_LEAN_AND_MEAN)

# Fix MSVC 19.40 crash with mutex due to spelunky using an old redist (mscvp140.dll)
# Related links: https://github.com/microsoft/STL/releases/tag/vs-2022-17.10 | https://github.com/actions/runner-images/issues/10004
add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)

if(BUILD_OVERLUNKY)
add_compile_definitions(SPEL2_EDITABLE_SCRIPTS)
add_compile_definitions(SPEL2_EXTRA_ANNOYING_SCRIPT_ERRORS)
Expand Down
2 changes: 1 addition & 1 deletion src/game_api/script/lua_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ LuaBackend::~LuaBackend()

{
std::lock_guard lock{g_all_backends_mutex};
std::erase_if(g_all_backends, [=](const std::unique_ptr<ProtectedBackend>& protected_backend)
std::erase_if(g_all_backends, [this](const std::unique_ptr<ProtectedBackend>& protected_backend)
{ return protected_backend.get() == self; });
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/game_api/sound_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ PlayingSound CustomSound::play(bool paused, SOUND_TYPE sound_type)
{
return std::visit(
overloaded{
[=](FMOD::Sound* sound)
[=, this](FMOD::Sound* sound)
{ return m_SoundManager->play_sound(sound, paused, sound_type == SOUND_TYPE::Music); },
[=](FMODStudio::EventDescription* event)
[=, this](FMODStudio::EventDescription* event)
{ return m_SoundManager->play_event(event, paused, sound_type == SOUND_TYPE::Music); },
[](std::monostate)
{
Expand Down

0 comments on commit 567761e

Please sign in to comment.