From 9fcbdc9a43a27abd5e2cac779901ce8ce6f36638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 17 May 2022 11:49:35 -0700 Subject: [PATCH] MSVC updated __cplusplus macro support. C++14 standard is required. --- include/bx/platform.h | 10 +++------- scripts/toolchain.lua | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/bx/platform.h b/include/bx/platform.h index c8e100f..d2519ec 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -438,13 +438,9 @@ # define BX_ARCH_NAME "64-bit" #endif // BX_ARCH_ -#if BX_COMPILER_MSVC -# define BX_CPP_NAME "C++MsvcUnknown" -#elif defined(__cplusplus) -# if __cplusplus < 201103L -# error "Pre-C++11 compiler is not supported!" -# elif __cplusplus < 201402L -# define BX_CPP_NAME "C++11" +#if defined(__cplusplus) +# if __cplusplus < 201402L +# error "C++14 standard support is required to build." # elif __cplusplus < 201703L # define BX_CPP_NAME "C++14" # elif __cplusplus < 201704L diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 26ad65c..a8b5a78 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -560,6 +560,7 @@ function toolchain(_buildDir, _libDir) "/wd4201", -- warning C4201: nonstandard extension used: nameless struct/union "/wd4324", -- warning C4324: '': structure was padded due to alignment specifier "/Ob2", -- The Inline Function Expansion + "/Zc:__cplusplus", -- Enable updated __cplusplus macro } linkoptions { "/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library