From 44e48ddc2785b037abd202a8d38b2ef2e8c36600 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 14 Dec 2024 23:15:34 +1100 Subject: initial commit --- qstd/plat.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 qstd/plat.h (limited to 'qstd/plat.h') 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 -- cgit v1.2.3-54-g00ecf