Remove warnings about static assertions

This commit is contained in:
Laurent Rineau 2012-01-23 12:29:17 +00:00
parent 056e040307
commit 0b760d0fbb
1 changed files with 35 additions and 14 deletions

View File

@ -80,24 +80,45 @@ inline bool possibly(Uncertain<bool> c);
# define CGAL_assertion(EX) (static_cast<void>(0)) # define CGAL_assertion(EX) (static_cast<void>(0))
# define CGAL_assertion_msg(EX,MSG) (static_cast<void>(0)) # define CGAL_assertion_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_assertion_code(CODE) # define CGAL_assertion_code(CODE)
# define CGAL_static_assertion(EX) #else // no CGAL_NO_ASSERTIONS
# define CGAL_static_assertion_msg(EX,MSG)
#else
# define CGAL_assertion(EX) \ # define CGAL_assertion(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) (CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
# define CGAL_assertion_msg(EX,MSG) \ # define CGAL_assertion_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) (CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_assertion_code(CODE) CODE # define CGAL_assertion_code(CODE) CODE
#endif // no CGAL_NO_ASSERTIONS
#ifndef CGAL_CFG_NO_CPP0X_STATIC_ASSERT #ifndef CGAL_CFG_NO_CPP0X_STATIC_ASSERT
# if defined(CGAL_NO_ASSERTIONS)
# define CGAL_static_assertion(EX) \
static_assert(true, "")
# define CGAL_static_assertion_msg(EX,MSG) \
static_assert(true, "")
# else // no CGAL_NO_ASSERTIONS
# define CGAL_static_assertion(EX) \ # define CGAL_static_assertion(EX) \
static_assert(EX, #EX) static_assert(EX, #EX)
# define CGAL_static_assertion_msg(EX,MSG) \ # define CGAL_static_assertion_msg(EX,MSG) \
static_assert(EX, MSG) static_assert(EX, MSG)
#else # endif // no CGAL_NO_ASSERTIONS
#else // if CGAL_CFG_NO_CPP0X_STATIC_ASSERT is true
# if defined(CGAL_NO_ASSERTIONS)
# define CGAL_static_assertion(EX) \
BOOST_STATIC_ASSERT(true)
# define CGAL_static_assertion_msg(EX,MSG) \
BOOST_STATIC_ASSERT(true)
# else // no CGAL_NO_ASSERTIONS
# define CGAL_static_assertion(EX) \ # define CGAL_static_assertion(EX) \
BOOST_STATIC_ASSERT(EX) BOOST_STATIC_ASSERT(EX)
@ -105,9 +126,9 @@ inline bool possibly(Uncertain<bool> c);
# define CGAL_static_assertion_msg(EX,MSG) \ # define CGAL_static_assertion_msg(EX,MSG) \
BOOST_STATIC_ASSERT(EX) BOOST_STATIC_ASSERT(EX)
#endif # endif // no CGAL_NO_ASSERTIONS
#endif // CGAL_NO_ASSERTIONS #endif // if CGAL_CFG_NO_CPP0X_STATIC_ASSERT is true
#if defined(CGAL_NO_ASSERTIONS) || !defined(CGAL_CHECK_EXACTNESS) #if defined(CGAL_NO_ASSERTIONS) || !defined(CGAL_CHECK_EXACTNESS)
# define CGAL_exactness_assertion(EX) (static_cast<void>(0)) # define CGAL_exactness_assertion(EX) (static_cast<void>(0))