From 98d3a4ccdcfd1063ef368d37a815e3d5a588871d Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sun, 31 Jan 2021 23:16:46 +0100 Subject: [PATCH] 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. --- build/msw/wx_setup.props | 1 + 1 file changed, 1 insertion(+) diff --git a/build/msw/wx_setup.props b/build/msw/wx_setup.props index bb0fb516b3..1257d08143 100644 --- a/build/msw/wx_setup.props +++ b/build/msw/wx_setup.props @@ -75,6 +75,7 @@ /Zc:threadSafeInit- %(AdditionalOptions) + /Zc:throwingNew %(AdditionalOptions) 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)