Skip to content

Commit dac9673

Browse files
committed
Trying another way to recognize C++23 with MSVC.
1 parent 800e50b commit dac9673

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

include/comms/CompileControl.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
#define COMMS_IS_CLANG_16_OR_ABOVE (COMMS_IS_CLANG && (__clang_major__ >= 16))
8989
#define COMMS_IS_CLANG_18_OR_BELOW (COMMS_IS_CLANG && (__clang_major__ <= 18))
9090
#define COMMS_IS_CLANG_19_OR_BELOW (COMMS_IS_CLANG && (__clang_major__ <= 19))
91+
#define COMMS_IS_MSVC_2025 (COMMS_IS_MSVC && (_MSC_VER >= 1940) && (_MSC_VER < 1950))
92+
#define COMMS_IS_MSVC_2025_OR_BELOW (COMMS_IS_MSVC && (_MSC_VER < 1950))
93+
#define COMMS_IS_MSVC_2022 (COMMS_IS_MSVC && (_MSC_VER >= 1930) && (_MSC_VER < 1940))
9194
#define COMMS_IS_MSVC_2019 (COMMS_IS_MSVC && (_MSC_VER >= 1920) && (_MSC_VER < 1930))
9295
#define COMMS_IS_MSVC_2019_OR_BELOW (COMMS_IS_MSVC && (_MSC_VER < 1930))
9396
#define COMMS_IS_MSVC_2017_OR_BELOW (COMMS_IS_MSVC && (_MSC_VER < 1920))
@@ -102,7 +105,12 @@
102105
#define COMMS_IS_CPP20 (__cplusplus >= 202002L)
103106
#define COMMS_IS_CPP23 (__cplusplus >= 202302L)
104107

105-
#if COMMS_IS_MSVC_2019_OR_BELOW // Visual Studio 2019
108+
#if COMMS_IS_MSVC_2025_OR_BELOW
109+
#undef COMMS_IS_CPP23
110+
#define COMMS_IS_CPP23 (__cplusplus >= 202003L)
111+
#endif
112+
113+
#if COMMS_IS_MSVC_2019_OR_BELOW
106114
#undef COMMS_IS_CPP20
107115
#define COMMS_IS_CPP20 (__cplusplus >= 201704L)
108116
#endif

0 commit comments

Comments
 (0)