From 4b2c899dc6244c92e4dd913d760a3408e79eda48 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Fri, 23 Nov 2012 12:02:57 +0000 Subject: [PATCH] Define static_assert in the same way Hopefully this won't change anything as we already had a check for it. However, it is now based compiler checks rather than version numbers. We haven't use static_assert anywhere in code yet anyway. --- .../PolyVoxCore/Impl/CompilerCapabilities.h.in | 2 ++ .../PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in index 6876d1a7..8c1638c3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in @@ -3,4 +3,6 @@ #cmakedefine HAS_CXX11_CONSTEXPR +#cmakedefine HAS_CXX11_STATIC_ASSERT + #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h index 20866217..e16b3b5a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h @@ -77,9 +77,6 @@ freely, subject to the following restrictions: #define polyvox_bind boost::bind #define polyvox_placeholder_1 _1 #define polyvox_placeholder_2 _2 - - #include - #define static_assert BOOST_STATIC_ASSERT //As long as we're requiring boost, we'll use it to compensate @@ -101,7 +98,6 @@ freely, subject to the following restrictions: #define polyvox_bind std::bind #define polyvox_placeholder_1 std::placeholders::_1 #define polyvox_placeholder_2 std::placeholders::_2 - //#define static_assert static_assert //we can use this #endif #if defined(HAS_CXX11_CONSTEXPR) @@ -112,4 +108,11 @@ freely, subject to the following restrictions: #define polyvox_constexpr #endif +#if defined(HAS_CXX11_STATIC_ASSERT) + //In this case we can just use static_assert +#else + #include + #define static_assert BOOST_STATIC_ASSERT +#endif + #endif