ref: 2fe8425df95a1e52d14185bf300551a52be4b8fe
parent: 6b681a6a53eabc3fe7bff7c20ea168ce9c9922e4
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Feb 16 10:31:53 EST 2017
[libc] Add implementation of assert()
--- /dev/null
+++ b/libc/src/assert.c
@@ -1,0 +1,13 @@
+/* See LICENSE file for copyright and license details. */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+void __assert(int status, char *exp, char *file, long line)
+{
+ if (status)
+ return;
+ fprintf(stderr, "%s:%ld: assertion failed '%s'\n", file, line, exp);
+ abort();
+}