diff options
Diffstat (limited to 'qstd/plat.h')
-rw-r--r-- | qstd/plat.h | 32 |
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 |