[hackers] [scc] [libc] Add implementation of assert() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 16 Feb 2017 15:37:13 +0100 (CET)

commit 0ddc858d7d576967bf7596b445ef7f1b19bb7e3d
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Feb 16 15:31:53 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 16 15:31:53 2017 +0100

    [libc] Add implementation of assert()

diff --git a/libc/src/assert.c b/libc/src/assert.c
new file mode 100644
index 0000000..0a6aa93
--- /dev/null
+++ b/libc/src/assert.c
_AT_@ -0,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();
+}
Received on Thu Feb 16 2017 - 15:37:13 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 16 2017 - 15:48:21 CET