Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:55:55

0001 //  (C) Copyright Matt Borland 2021.
0002 //  Use, modification and distribution are subject to the
0003 //  Boost Software License, Version 1.0. (See accompanying file
0004 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 //
0006 // We deliberately use assert in here:
0007 //
0008 // boost-no-inspect
0009 
0010 #ifndef BOOST_MATH_TOOLS_ASSERT_HPP
0011 #define BOOST_MATH_TOOLS_ASSERT_HPP
0012 
0013 #include <boost/math/tools/config.hpp>
0014 
0015 #ifdef BOOST_MATH_HAS_GPU_SUPPORT
0016 
0017 // Run time asserts are generally unsupported
0018 
0019 #define BOOST_MATH_ASSERT(expr)
0020 #define BOOST_MATH_ASSERT_MSG(expr, msg)
0021 #define BOOST_MATH_STATIC_ASSERT(expr) static_assert(expr, #expr " failed")
0022 #define BOOST_MATH_STATIC_ASSERT_MSG(expr, msg) static_assert(expr, msg)
0023 
0024 #else
0025 
0026 #include <boost/math/tools/is_standalone.hpp>
0027 
0028 #ifndef BOOST_MATH_STANDALONE
0029 
0030 #include <boost/assert.hpp>
0031 #include <boost/static_assert.hpp>
0032 #define BOOST_MATH_ASSERT(expr) BOOST_ASSERT(expr)
0033 #define BOOST_MATH_ASSERT_MSG(expr, msg) BOOST_ASSERT_MSG(expr, msg)
0034 #define BOOST_MATH_STATIC_ASSERT(expr) BOOST_STATIC_ASSERT(expr)
0035 #define BOOST_MATH_STATIC_ASSERT_MSG(expr, msg) BOOST_STATIC_ASSERT_MSG(expr, msg)
0036 
0037 #else // Standalone mode - use cassert
0038 
0039 #include <cassert>
0040 #define BOOST_MATH_ASSERT(expr) assert(expr)
0041 #define BOOST_MATH_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
0042 #define BOOST_MATH_STATIC_ASSERT(expr) static_assert(expr, #expr " failed")
0043 #define BOOST_MATH_STATIC_ASSERT_MSG(expr, msg) static_assert(expr, msg)
0044 
0045 #endif // Is standalone
0046 
0047 #endif // BOOST_MATH_HAS_GPU_SUPPORT
0048 
0049 #endif // BOOST_MATH_TOOLS_ASSERT_HPP