2
0
Эх сурвалжийг харах

Merge pull request #3849 from ThomasWaldmann/hashindex-debug-print

add debug_print macro for hashindex debugging, see #3807
TW 7 жил өмнө
parent
commit
ce069035ce
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_LEN 8
 
+#define DEBUG 0
+
+#define debug_print(fmt, ...)                   \
+  do {                                          \
+    if (DEBUG) {                                \
+      fprintf(stderr, fmt, __VA_ARGS__);        \
+      fflush(NULL);                             \
+    }                                           \
+} while (0)
+
 typedef struct {
     char magic[MAGIC_LEN];
     int32_t num_entries;