From 837de0582e817bbf6910c05c6fabe554429adbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 21 Nov 2023 19:30:30 -0800 Subject: [PATCH] Add error when __cplusplus MSVC compiler option is not configured correctly. --- include/bx/platform.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/bx/platform.h b/include/bx/platform.h index b4197f8..5f0dcca 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -42,7 +42,6 @@ #endif // BX_CRT_NONE // Language standard version -#define BX_LANGUAGE_CPP14 201402L #define BX_LANGUAGE_CPP17 201703L #define BX_LANGUAGE_CPP20 202002L #define BX_LANGUAGE_CPP23 202207L @@ -445,10 +444,12 @@ #endif // BX_ARCH_ #if defined(__cplusplus) -# if __cplusplus < BX_LANGUAGE_CPP14 -# error "C++14 standard support is required to build." -# elif __cplusplus < BX_LANGUAGE_CPP17 -# define BX_CPP_NAME "C++14" +# if defined(_MSVC_LANG) && _MSVC_LANG != __cplusplus +# error "When using MSVC you must set /Zc:__cplusplus compiler option." +# endif // defined(_MSVC_LANG) && _MSVC_LANG != __cplusplus + +# if __cplusplus < BX_LANGUAGE_CPP17 +# error "C++17 standard support is required to build." # elif __cplusplus < BX_LANGUAGE_CPP20 # define BX_CPP_NAME "C++17" # elif __cplusplus < BX_LANGUAGE_CPP23