Add error when __cplusplus MSVC compiler option is not configured correctly.

This commit is contained in:
Branimir Karadžić
2023-11-21 19:30:30 -08:00
parent fe540e7657
commit 837de0582e

View File

@@ -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