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