summaryrefslogtreecommitdiff
path: root/qstd/plat.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-14 23:15:34 +1100
committerquou <quou@disroot.org>2024-12-14 23:19:17 +1100
commit44e48ddc2785b037abd202a8d38b2ef2e8c36600 (patch)
treef58887ce48f7fdbf6dcca365b2a1b02a34e1b355 /qstd/plat.h
initial commit
Diffstat (limited to 'qstd/plat.h')
-rw-r--r--qstd/plat.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/qstd/plat.h b/qstd/plat.h
new file mode 100644
index 0000000..27521fa
--- /dev/null
+++ b/qstd/plat.h
@@ -0,0 +1,32 @@
+#ifndef plat_h
+#define plat_h
+
+#ifdef assert
+#undef assert
+#endif
+
+#ifdef DEBUG
+#define assert(expr) \
+ imp_assert( \
+ expr, \
+ #expr, \
+ __FILE__, \
+ __LINE__ \
+ )
+#else
+#define assert(expr)
+#endif
+
+int imp_assert(
+ int val,
+ const char* expr,
+ const char* file,
+ int line
+);
+
+void print(const char* fmt, ...);
+void print_err(const char* fmt, ...);
+void print_war(const char* fmt, ...);
+void pbreak(int code);
+
+#endif