summaryrefslogtreecommitdiff
path: root/src/dbg.h
diff options
context:
space:
mode:
authorJulien Dessaux2016-08-17 19:32:19 +0200
committerJulien Dessaux2016-08-17 19:33:51 +0200
commit1b03e5bfb2317804619057924e7261fd49f68a54 (patch)
tree19a439a9b266c667566d2387cf83161e88a94abb /src/dbg.h
parentWrote a proper IRC parser (diff)
downloadb98-1b03e5bfb2317804619057924e7261fd49f68a54.tar.gz
b98-1b03e5bfb2317804619057924e7261fd49f68a54.tar.bz2
b98-1b03e5bfb2317804619057924e7261fd49f68a54.zip
Rewrote a part of the C wrapper for clarity and bug fixingHEADmaster
Diffstat (limited to 'src/dbg.h')
-rw-r--r--src/dbg.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dbg.h b/src/dbg.h
new file mode 100644
index 0000000..e8b0d91
--- /dev/null
+++ b/src/dbg.h
@@ -0,0 +1,14 @@
+#ifndef _DBG_H_
+#define _DBG_H_
+
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define DBG(fmt, ...) \
+ do { \
+ /*fprintf(stderr, "%s:%d:%lu " fmt "\n", __FILE__, __LINE__, pthread_self(), ##__VA_ARGS__);*/ \
+ fprintf(stderr, "%s:%d:%lu " fmt "\n", __FILE__, __LINE__, syscall(SYS_gettid), ##__VA_ARGS__); \
+ } while (0)
+
+#endif