Create new assert macro, that can log the values in the expression

* The main motivation for this is because it's convenient to be able
  to just assert a simple expression rather than print a proper error
  message, but then after the fact you want to know what the value was
  (e.g. a return code, or similar).
This commit is contained in:
baldurk committed 2016-02-27 17:29:16 +01:00
1 parent 7b8097690d
commit 542131624f
3 files changed
+132 -5

No files matched your search

+2 -2
View File
@@ -82,9 +82,9 @@ float SRGB8_lookuptable[256] = {
0.938686f, 0.947307f, 0.955974f, 0.964686f, 0.973445f, 0.982251f, 0.991102f, 1.000000f,
};
void rdcassert(const char *condition, const char *file, unsigned int line, const char *func)
void rdcassert(const char *msg, const char *file, unsigned int line, const char *func)
{
rdclog_int(RDCLog_Error, file, line, "Assertion failed: '%s'", condition, file, line);
rdclog_int(RDCLog_Error, file, line, "Assertion failed: %s", msg);
}
#if 0