summaryrefslogtreecommitdiff
path: root/src/dbg.h
diff options
context:
space:
mode:
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