static_assert.hpp 861 B

123456789101112131415161718192021222324252627
  1. /// Copyright (c) 2008-2021 Emil Dotchevski and Reverge Studios, Inc.
  2. /// Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. /// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef BOOST_QVM_STATIC_ASSERT
  5. # if __cplusplus >= 201103L
  6. # include <utility>
  7. # define BOOST_QVM_STATIC_ASSERT(condition) static_assert(condition, "Boost QVM static assertion failure")
  8. # else
  9. # ifdef __GNUC__
  10. # define BOOST_QVM_ATTRIBUTE_UNUSED __attribute__((unused))
  11. # else
  12. # define BOOST_QVM_ATTRIBUTE_UNUSED
  13. # endif
  14. # define BOOST_QVM_TOKEN_PASTE(x, y) x ## y
  15. # define BOOST_QVM_TOKEN_PASTE2(x, y) BOOST_QVM_TOKEN_PASTE(x, y)
  16. # define BOOST_QVM_STATIC_ASSERT(condition) typedef char BOOST_QVM_TOKEN_PASTE2(boost_qvm_static_assert_failure_,__LINE__)[(condition)?1:-1] BOOST_QVM_ATTRIBUTE_UNUSED
  17. # endif
  18. #endif