Enable standard-confirming new behaviour in MSVS 201x projects
Use /Zc:throwingNew option for the compilers supporting it instead of defaulting to compatible behaviour, which assumes that operator new can return NULL on allocation failure, that we don't need, at least in the release builds. This is also slightly more efficient as it allows the compiler to avoid generating null checks after calling new. Closes #19069.
This commit is contained in:
parent
e7cd875ab0
commit
98d3a4ccdc
1 changed files with 1 additions and 0 deletions
|
|
@ -75,6 +75,7 @@
|
|||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalOptions Condition="'$(PlatformToolset)' == 'v140_xp'">/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="('$(Configuration)'=='Release' or '$(Configuration)'=='DLL Release') and '$(VisualStudioVersion)' >= '14.0'">/Zc:throwingNew %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;shell32.lib;shlwapi.lib;ole32.lib;oleaut32.lib;uuid.lib;advapi32.lib;version.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;wininet.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue