Skip to content

Commit

Permalink
feat(cmake): update assert message format like "Assertion failed: (fa…
Browse files Browse the repository at this point in the history
…lse), at ZLMediaKit/ext-codec/H264Rtmp.cpp#42@foobar"
  • Loading branch information
johzzy committed Nov 22, 2024
1 parent 9e319b7 commit 12f9eba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,13 @@ void Assert_Throw(int failed, const char *exp, const char *func, const char *fil
if(str && *str){
printer << ", " << str;
}
printer << "), function " << func << ", file " << file << ", line " << line << ".";
#if defined(ZLMediaKit_PREFIX_LENGTH)
// Assertion failed: (false), at ZLMediaKit/ext-codec/H264Rtmp.cpp#42@foobar
printer << "), at " << (file+ ZLMediaKit_PREFIX_LENGTH + 1) << "#" << line << "@" << func;
#else
printer << "), at " << file << "#" << line << "@" << func;
#endif

throw toolkit::AssertFailedException(printer);
}
}
Expand Down

0 comments on commit 12f9eba

Please sign in to comment.