summaryrefslogtreecommitdiff
path: root/include/ulib/assert.h
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-01-02 10:09:37 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-01-02 10:09:37 +0800
commit1c8e37f63d413a559825020289178d442537449e (patch)
tree9779a712b5eec91035272e7646eb6811979d7eab /include/ulib/assert.h
parentd8eaa13f2efc1eeca4e5f230d5a2d535aaf27338 (diff)
downloadlume-1c8e37f63d413a559825020289178d442537449e.tar.gz
lume-1c8e37f63d413a559825020289178d442537449e.tar.xz
dev(sell): add simple libc and implement shell
please see the log for detail.
Diffstat (limited to 'include/ulib/assert.h')
-rw-r--r--include/ulib/assert.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/ulib/assert.h b/include/ulib/assert.h
new file mode 100644
index 0000000..a083aff
--- /dev/null
+++ b/include/ulib/assert.h
@@ -0,0 +1,20 @@
+#ifndef _ASSERT_H
+#define _ASSERT_H
+
+#ifdef NDEBUG
+#define assert(ignore) ((void)0)
+#else
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+ void __assert_fail(const char *expr, const char *file, int line, const char *func);
+#ifdef __cplusplus
+}
+#endif
+
+#define assert(expr) \
+ ((expr) ? (void)0 : __assert_fail(#expr, __FILE__, __LINE__, __func__))
+#endif
+
+#endif \ No newline at end of file