Tweaks to nhassert implementation. Change to warnings on MSC build.

This commit is contained in:
Bart House
2019-07-12 18:40:34 -07:00
parent 0e8e5aac93
commit 2f3da35c68
5 changed files with 44 additions and 4 deletions

View File

@@ -583,9 +583,20 @@ VA_DECL(const char *, str)
}
/* nhassert_failed is called when an nhassert's condition is false */
void nhassert_failed(const char * exp, const char * file, int line)
void
nhassert_failed(filepath, line)
const char * filepath;
int line;
{
impossible("NHASSERT(%s) in '%s' at line %d", exp, file, line);
const char * filename;
/* attempt to get filename from path. TODO: we really need a port provided
* function to return a filename from a path */
filename = strrchr(filepath, '/');
filename = (filename == NULL ? strrchr(filepath, '\\') : filename);
filename = (filename == NULL ? filepath : filename + 1);
impossible("nhassert failed in file '%s' at line %d", filename, line);
}
/*pline.c*/