CHECK宏支持自定义错误提示

This commit is contained in:
ziyue
2021-10-16 16:24:40 +08:00
parent 11eb04f094
commit b10fc52384
4 changed files with 55 additions and 18 deletions

View File

@@ -307,22 +307,10 @@ const string kMediaTimeoutMS = "media_timeout_ms";
const string kBeatIntervalMS = "beat_interval_ms";
const string kMaxAnalysisMS = "max_analysis_ms";
const string kBenchmarkMode = "benchmark_mode";
}
} // namespace mediakit
extern "C" {
void Assert_Throw(int failed, const char *exp, const char *func, const char *file, int line) {
if (failed) {
_StrPrinter printer;
printer << "Assertion failed: (" << exp << "), function " << func << ", file " << file << ", line " << line
<< ".";
throw std::runtime_error(printer);
}
}
}
#ifdef ENABLE_MEM_DEBUG
static atomic<uint64_t> mem_usage(0);