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>
50#define PRECICE_ASSERT_WRAPPER() assert(false)
52#define PRECICE_ASSERT_WRAPPER() std::abort()
59#define PRECICE_ASSERT_IMPL(check, args) \
62 std::cerr << precice::utils::format_or_error( \
63 precice::utils::ASSERT_FMT, \
64 BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, \
65 BOOST_PP_STRINGIZE(check), \
66 precice::utils::Parallel::getProcessRank(), \
71 PRECICE_ASSERT_WRAPPER(); \
59#define PRECICE_ASSERT_IMPL(check, args) \ …
75#define PRECICE_ASSERT_IMPL_N(check, ...) \
76 PRECICE_ASSERT_IMPL(check, PRECICE_LOG_ARGUMENTS(__VA_ARGS__))
75#define PRECICE_ASSERT_IMPL_N(check, ...) \ …
78#define PRECICE_ASSERT_IMPL_1(check) \
79 PRECICE_ASSERT_IMPL(check, "none")
78#define PRECICE_ASSERT_IMPL_1(check) \ …
85#define PRECICE_ASSERT(...) \
86 BOOST_PP_CAT(PRECICE_ASSERT_IMPL_, BOOST_PP_IF(BOOST_PP_GREATER(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 1), N, 1)) \
85#define PRECICE_ASSERT(...) \ …
93#define PRECICE_UNREACHABLE(...) \
95 std::cerr << ::precice::utils::format_or_error(__VA_ARGS__) << std::endl; \
93#define PRECICE_UNREACHABLE(...) \ …
contains precice-related utilities.
static constexpr std::string_view ASSERT_FMT