1 #ifndef GINAC_PARSER_DEBUG_HPP
2 #define GINAC_PARSER_DEBUG_HPP
8 #if __STDC_VERSION__ < 199901L
9 #define __PRETTY_FUNCTION__ "<unknown>"
11 #define __PRETTY_FUNCTION__ __func__
15 #define bail_out(exception, message) \
17 std::ostringstream err; \
18 err << __PRETTY_FUNCTION__ << "(" << __FILE__ << ':' << __LINE__ << ": "; \
20 throw exception(err.str()); \
23 #define bug(message) bail_out(std::logic_error, message)
25 #define dout(condition, message) \
27 if (unlikely(condition)) { \
28 std::cerr << __PRETTY_FUNCTION__ \
29 << " (" << __FILE__ << ':' << __LINE__ << "): " \
30 << message << std::endl; \
34 #endif // GINAC_PARSER_DEBUG_HPP