From 5cf15a9b11cfdfaaa58698708cd1d222efc00226 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 25 Mar 2022 21:37:39 +0100 Subject: [PATCH] Try to work around the issue with . --- lib/globals.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/globals.h b/lib/globals.h index 580ab03d..576dc9aa 100644 --- a/lib/globals.h +++ b/lib/globals.h @@ -1,6 +1,20 @@ #ifndef GLOBALS_H #define GLOBALS_H +#if defined(_MSVC_LANG) + #define CPP_VERSION _MSVC_LANG +#else + #define CPP_VERSION __cplusplus +#endif + +#define CPP20_PRESENT (CPP_VERSION >= 202002L) + +#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_three_way_comparison) + #define CPP20_COMPARISONS_PRESENT ((__cpp_impl_three_way_comparison >= 201907L) && (__cpp_lib_three_way_comparison >= 201907L)) +#else + #define CPP20_COMPARISONS_PRESENT CPP20_PRESENT +#endif + #include #include #include @@ -15,7 +29,10 @@ #include #include #include -#include + +#if defined CPP20_COMPARISONS_PRESENT + #include +#endif #if defined(_WIN32) || defined(__WIN32__) #include