Line data Source code
1 : #include "Assertions.h" 2 : 3 : namespace elsa::detail 4 : { 5 0 : void assert_nomsg(const char* expr_str, bool expr, const char* file, int line) 6 : { 7 0 : if (!expr) { 8 : std::cerr << "Assert failed:\n" 9 : << "Expected:\t" << expr_str << "\n" 10 0 : << "Source:\t\t" << file << ", line " << line << "\n"; 11 0 : abort(); 12 : } 13 0 : } 14 : 15 0 : void assert_msg(const char* expr_str, bool expr, const char* file, int line, const char* msg) 16 : { 17 0 : if (!expr) { 18 : std::cerr << "Assert failed:\t" << msg << "\n" 19 : << "Expected:\t" << expr_str << "\n" 20 0 : << "Source:\t\t" << file << ", line " << line << "\n"; 21 0 : abort(); 22 : } 23 0 : } 24 : } // namespace elsa::detail