aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-01-13 09:15:38 +0100
committerMartin Ridgers <[email protected]>2022-01-13 09:15:38 +0100
commit3e02267fe465bef014426d11d3e2b6ab45c82503 (patch)
tree76314ce038f86fd967ba9ab0886b408c8506b193 /zencore/include
parentThe "operator << (CbWriter, size_t)" is only required when using libc++ (diff)
downloadzen-3e02267fe465bef014426d11d3e2b6ab45c82503.tar.xz
zen-3e02267fe465bef014426d11d3e2b6ab45c82503.zip
More complete toolchain and C++ library version checks
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/zencore.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h
index 0b45b12cf..26155abc8 100644
--- a/zencore/include/zencore/zencore.h
+++ b/zencore/include/zencore/zencore.h
@@ -64,15 +64,6 @@
# error Unknown compiler
#endif
-// Check for C++20 support
-#if !ZEN_PLATFORM_WINDOWS
-# if ZEN_COMPILER_CLANG && __clang_major__ < 14
-# error LLVM-14 onwards required for complete C++20 support
-# elif ZEN_COMPILER_GCC && __GNUC__ < 11
-# error GCC-11 onwards required for complete C++20 support
-# endif
-#endif
-
#if ZEN_COMPILER_MSC
# pragma warning(disable : 4324) // warning C4324: '<type>': structure was padded due to alignment specifier
# pragma warning(default : 4668) // warning C4668: 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
@@ -120,6 +111,30 @@
} while (0)
#endif
+//////////////////////////////////////////////////////////////////////////
+// C++20 support
+//
+
+// Clang
+#if ZEN_COMPILER_CLANG && __clang_major__ < 12
+# error clang-12 onwards is required for C++20 support
+#endif
+
+// GCC
+#if ZEN_COMPILER_GCC && __GNUC__ < 11
+# error GCC-11 onwards is required for C++20 support
+#endif
+
+// GNU libstdc++
+#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 11
+# error GNU libstdc++-11 onwards is required for C++20 support
+#endif
+
+// LLVM libc++
+#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 12000
+# error LLVM libc++-12 onwards is required for C++20 support
+#endif
+
// At the time of writing only ver >= 13 of LLVM's libc++ has an implementation
// of std::integral. Some platforms like Ubuntu and Mac OS are still on 12.
#if defined(__cpp_lib_concepts)