summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/misc/assert/__assert.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c
index 2ce86c3f1..905671d98 100644
--- a/libc/misc/assert/__assert.c
+++ b/libc/misc/assert/__assert.c
@@ -15,17 +15,20 @@ const char *str;
write(2, str, strlen(str));
}
-void __assert(assertion, filename, linenumber)
+void __assert(assertion, filename, linenumber, function)
const char *assertion;
const char *filename;
int linenumber;
+const char *function;
{
- errput("Failed assertion '");
- errput(assertion);
- errput("' in file ");
errput(filename);
- errput(" at line ");
+ errput(":");
errput(itoa(linenumber));
- errput(".\n");
+ errput(function ? ": " : "");
+ errput(function ? function : "");
+ errput(function ? "() " : "");
+ errput(": Assertion \"");
+ errput(assertion);
+ errput("\" failed.\n");
abort();
}