Skip to content

Commit

Permalink
Merge pull request #580 from UE4SS-RE/(Fix)MSVCMutexConstexpr
Browse files Browse the repository at this point in the history
STL updates Mutex Fix

microsoft/STL#3824
microsoft/STL#4000
microsoft/STL#4339

Add escape hatch due to STL change resulting in issues with binary compatibility.

https://github.com/microsoft/STL/wiki/Changelog
"Fixed bugs:

    Fixed mutex's constructor to be constexpr. #3824 #4000 #4339
        Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in mutex machinery. You must follow this rule:

            When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component.

        You can define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR as an escape hatch."**Description**
  • Loading branch information
narknon authored Jun 27, 2024
2 parents 3524b88 + bc157e8 commit 6867a08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deps/third-repo/packages/p/polyhook_2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ include(FetchContent)

set(FETCHCONTENT_QUIET OFF)

# Add the preprocessor definition to fix mutex
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)

FetchContent_Declare(PolyHook2
GIT_REPOSITORY https://github.com/stevemk14ebr/PolyHook_2_0.git
GIT_TAG fd2a88f09c8ae89440858fc52573656141013c7f
Expand Down
3 changes: 3 additions & 0 deletions tools/xmakescripts/rules/build_rules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ local MSVC_COMPILE_OPTIONS = {
},
["shflags"] = {
"/DEBUG:FULL"
},
["defines"] = {
"_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR=1"
}
}

Expand Down

0 comments on commit 6867a08

Please sign in to comment.