Skip to content

Commit

Permalink
Merge pull request #386 from estebanfer/fix-MSVC-19.40-build
Browse files Browse the repository at this point in the history
fix MSVC 19.40 build crashing, fix clangd warnings
  • Loading branch information
Dregu authored Jun 27, 2024
2 parents b65022e + e261ab3 commit 1536e5b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/continous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
steps:
- uses: llvm/actions/install-ninja@main

- name: Install llvm 17
if: matrix.toolset_name == 'Ninja'
run: choco install llvm --version 17.0.6 --allow-downgrade -y

- uses: actions/checkout@v2
with:
fetch-depth: 1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/whip-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
steps:
- uses: llvm/actions/install-ninja@main

- name: Install llvm 17
run: choco install llvm --version 17.0.6 --allow-downgrade -y

- uses: actions/checkout@v2
with:
fetch-depth: 1
Expand Down
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/fmt
Submodule fmt updated 226 files
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
2 changes: 1 addition & 1 deletion src/json
Submodule json updated 1433 files
2 changes: 1 addition & 1 deletion src/shared/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct fmt::formatter<ByteStr>
}

template <typename FormatContext>
auto format(ByteStr byte_str, FormatContext& ctx)
auto format(const ByteStr& byte_str, FormatContext& ctx) const
{
auto out = ctx.out();

Expand Down

0 comments on commit 1536e5b

Please sign in to comment.