From ce4d248e0bab814c90e424389c178083978f4909 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 19 May 2018 22:26:56 +0200 Subject: [PATCH] add debug_print macro for hashindex debugging, see #3807 --- src/borg/_hashindex.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/borg/_hashindex.c b/src/borg/_hashindex.c index c7a5b0d0f..10af80eac 100644 --- a/src/borg/_hashindex.c +++ b/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;