1 #ifndef GINAC_MOD_GCD_DEBUG_HPP
2 #define GINAC_MOD_GCD_DEBUG_HPP
8 #define DEBUG_PREFIX __func__ << ':' << __LINE__ << ": "
9 #define EXCEPTION_PREFIX std::string(__func__) + std::string(": ") +
11 #define Dout2(stream, msg) \
13 stream << DEBUG_PREFIX << msg << std::endl << std::flush; \
15 #define Dout(msg) Dout2(std::cout, msg)
17 #define bug3_on(condition, the_exception, msg) \
19 if (unlikely(condition)) { \
20 std::ostringstream err_stream; \
21 Dout2(err_stream, "BUG: " << msg); \
22 throw the_exception(err_stream.str()); \
26 #define bug_on(condition, msg) bug3_on(condition, std::logic_error, msg)
28 #endif // GINAC_MOD_GCD_DEBUG_HPP