Fix binary compatibility with older C runtimes on Windows - #2612
Merged
Conversation
…ies compatible with older C runtimes.
hoffstadt
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
name: Pull Request
about: Create a pull request to help us improve
title: Fix binary compatibility with older C runtimes on Windows
assignees: ''
Description:
At some point, Visual Studio 2022 started producing code no longer compatible with older versions of
msvcp140.dll, which is a part of VC redistributable package. Since VS 2022 is used on GitHub for our release builds, this issue shows up in DPG versions 2.1 and 2.2 where most DPG API calls segfault for no obvious reason. A number of DPG users reported this, e.g. in #2535 and on Discord.Here are some discussions related to this change in Visual Studio:
https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio
actions/runner-images#10004
This fix adds
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTORto circumvent the issue and make DPG compatible with the older runtimes again.Another thing it fixes is a warning from PVS Studio on how
mvFontManageroverrides a field in the base class. I decided to combine these two fixes rather than put each of them into a separate tiny PR.Concerning Areas:
None.