MSVC fixes

This commit is contained in:
Sy Brand
2025-01-21 10:58:22 +00:00
parent 5ec21f29fa
commit db7add9a80

View File

@@ -53,7 +53,7 @@
#if !defined(TL_ASSERT) #if !defined(TL_ASSERT)
//can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug //can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
#if (__cplusplus > 201103L) && !defined(TL_EXPECTED_GCC49) #if (TL_CPLUSPLUS > 201103L) && !defined(TL_EXPECTED_GCC49)
#include <cassert> #include <cassert>
#define TL_ASSERT(x) assert(x) #define TL_ASSERT(x) assert(x)
#else #else
@@ -109,7 +109,13 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
std::is_trivially_destructible<T> std::is_trivially_destructible<T>
#endif #endif
#if __cplusplus > 201103L || (defined(_MSC_VER) && _MSC_VER >= 1910) #ifdef _MSVC_LANG
#define TL_CPLUSPLUS _MSVC_LANG
#else
#define TL_CPLUSPLUS __cplusplus
#endif
#if TL_CPLUSPLUS > 201103L
#define TL_EXPECTED_CXX14 #define TL_EXPECTED_CXX14
#endif #endif
@@ -119,7 +125,7 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
#define TL_EXPECTED_GCC49_CONSTEXPR constexpr #define TL_EXPECTED_GCC49_CONSTEXPR constexpr
#endif #endif
#if (__cplusplus == 201103L || defined(TL_EXPECTED_MSVC2015) || \ #if (TL_CPLUSPLUS == 201103L || defined(TL_EXPECTED_MSVC2015) || \
defined(TL_EXPECTED_GCC49)) defined(TL_EXPECTED_GCC49))
#define TL_EXPECTED_11_CONSTEXPR #define TL_EXPECTED_11_CONSTEXPR
#else #else