reformat DEBUG messages
[c11tester.git] / libthreads.h
index 3324fccfdf0b902866748ec964ca15ebc4071783..a25b27797268326ca63db433b31ffcd4897c0b22 100644 (file)
@@ -4,12 +4,14 @@
 #include <stdio.h>
 #include <ucontext.h>
 
+//#define CONFIG_DEBUG
+
 #ifdef CONFIG_DEBUG
-#define DBG() do { printf("Here: %s, L%d\n", __func__, __LINE__); } while (0)
-#define DEBUG(fmt, ...) printf(fmt, ##__VA_ARGS__)
+#define DEBUG(fmt, ...) do { printf("*** %25s(): line %-4d *** " fmt, __func__, __LINE__, ##__VA_ARGS__); } while (0)
+#define DBG() DEBUG("\n");
 #else
-#define DBG()
 #define DEBUG(fmt, ...)
+#define DBG()
 #endif
 
 struct thread {