msvc: enable conformant __cplusplus macro

This commit is contained in:
Shawn Hoffman 2022-04-02 02:07:41 -07:00
parent 25c173cefc
commit e6ed77b5f6
2 changed files with 2 additions and 2 deletions

View File

@ -265,7 +265,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# Fix non-conformant lambda behavior (constexpr variables shouldn't need capturing) # Fix non-conformant lambda behavior (constexpr variables shouldn't need capturing)
add_compile_options(/experimental:newLambdaProcessor) add_compile_options(/experimental:newLambdaProcessor)
# Fix various other non-conformant behaviors # Fix various other non-conformant behaviors
add_compile_options(/Zc:externConstexpr,lambda,preprocessor) add_compile_options(/Zc:__cplusplus,externConstexpr,lambda,preprocessor)
# Temporarily disable warnings to enable /Zc:preprocessor compatibility with WinSDK headers. # Temporarily disable warnings to enable /Zc:preprocessor compatibility with WinSDK headers.
add_compile_options( add_compile_options(

View File

@ -97,7 +97,7 @@
<!--Enable Standard Conformance--> <!--Enable Standard Conformance-->
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<!--Enforce some behaviors as standards-conformant when they don't default as such.--> <!--Enforce some behaviors as standards-conformant when they don't default as such.-->
<AdditionalOptions>/Zc:externConstexpr,lambda,preprocessor,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus,externConstexpr,lambda,preprocessor,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions>
<!--Enable detailed debug info--> <!--Enable detailed debug info-->
<AdditionalOptions>/Zo %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zo %(AdditionalOptions)</AdditionalOptions>
<!--Treat sources as utf-8--> <!--Treat sources as utf-8-->