瀏覽代碼

add debug_print macro for hashindex debugging, see #3807

Thomas Waldmann 7 年之前
父節點
當前提交
ce4d248e0b
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/borg/_hashindex.c

+ 10 - 0
src/borg/_hashindex.c

@@ -15,6 +15,16 @@
 #define MAGIC "BORG_IDX"
 #define MAGIC "BORG_IDX"
 #define MAGIC_LEN 8
 #define MAGIC_LEN 8
 
 
+#define DEBUG 0
+
+#define debug_print(fmt, ...)                   \
+  do {                                          \
+    if (DEBUG) {                                \
+      fprintf(stderr, fmt, __VA_ARGS__);        \
+      fflush(NULL);                             \
+    }                                           \
+} while (0)
+
 typedef struct {
 typedef struct {
     char magic[MAGIC_LEN];
     char magic[MAGIC_LEN];
     int32_t num_entries;
     int32_t num_entries;