1 #ifndef GINAC_MOD_GCD_DEBUG_HPP
2 #define GINAC_MOD_GCD_DEBUG_HPP
9 #define DEBUG_PREFIX __func__ << ':' << __LINE__ << ": "
10 #define EXCEPTION_PREFIX std::string(__func__) + std::string(": ") +
12 #define Dout2(stream, msg) \
14 stream << DEBUG_PREFIX << msg << std::endl << std::flush; \
16 #define Dout(msg) Dout2(std::cout, msg)
18 #define bug3_on(condition, the_exception, msg) \
20 if (unlikely(condition)) { \
21 std::ostringstream err_stream; \
22 Dout2(err_stream, "BUG: " << msg); \
23 throw the_exception(err_stream.str()); \
27 #define bug_on(condition, msg) bug3_on(condition, std::logic_error, msg)
29 #endif // GINAC_MOD_GCD_DEBUG_HPP