aboutsummaryrefslogtreecommitdiff
path: root/user/include/weenix/debug.h
diff options
context:
space:
mode:
authornthnluu <nate1299@me.com>2024-01-28 21:20:27 -0500
committernthnluu <nate1299@me.com>2024-01-28 21:20:27 -0500
commitc63f340d90800895f007de64b7d2d14624263331 (patch)
tree2c0849fa597dd6da831c8707b6f2603403778d7b /user/include/weenix/debug.h
Created student weenix repository
Diffstat (limited to 'user/include/weenix/debug.h')
-rw-r--r--user/include/weenix/debug.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/user/include/weenix/debug.h b/user/include/weenix/debug.h
new file mode 100644
index 0000000..a30641e
--- /dev/null
+++ b/user/include/weenix/debug.h
@@ -0,0 +1,12 @@
+#include "stdio.h"
+
+int debug(const char *str);
+
+#define dbg(fmt, args...) \
+ do \
+ { \
+ char temp[2048]; \
+ snprintf(temp, sizeof(temp), "%s:%d %s(): " fmt, __FILE__, __LINE__, \
+ __func__, ##args); \
+ debug(temp); \
+ } while (0);