12#if defined(NDEBUG) && !defined(PRECICE_RELEASE_WITH_ASSERTIONS)
13#define PRECICE_NO_ASSERTIONS
16#ifdef PRECICE_NO_ASSERTIONS
20#define PRECICE_ASSERT(...) \
21 ::precice::utils::ignore(__VA_ARGS__)
25#include <boost/current_function.hpp>
26#include <boost/preprocessor/comparison/greater.hpp>
27#include <boost/preprocessor/control/if.hpp>
28#include <boost/preprocessor/stringize.hpp>
29#include <boost/preprocessor/variadic/size.hpp>
52#define PRECICE_ASSERT_WRAPPER() assert(false)
54#define PRECICE_ASSERT_WRAPPER() std::abort()
61#define PRECICE_ASSERT_IMPL(check, args) \
64 std::cerr << precice::utils::format_or_error( \
65 precice::utils::ASSERT_FMT, \
66 BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, \
67 BOOST_PP_STRINGIZE(check), \
68 precice::utils::Parallel::getProcessRank(), \
73 PRECICE_ASSERT_WRAPPER(); \
77#define PRECICE_ASSERT_IMPL_N(check, ...) \
78 PRECICE_ASSERT_IMPL(check, PRECICE_LOG_ARGUMENTS(__VA_ARGS__))
80#define PRECICE_ASSERT_IMPL_1(check) \
81 PRECICE_ASSERT_IMPL(check, "none")
87#define PRECICE_ASSERT(...) \
88 BOOST_PP_CAT(PRECICE_ASSERT_IMPL_, BOOST_PP_IF(BOOST_PP_GREATER(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 1), N, 1)) \
95#define PRECICE_UNREACHABLE(...) \
97 std::cerr << ::precice::utils::format_or_error(__VA_ARGS__) << std::endl; \
static constexpr std::string_view ASSERT_FMT
Main namespace of the precice library.