From dee08caabb1b9139a59a51babf614dc39019c09e Mon Sep 17 00:00:00 2001 From: Sean Purcell Date: Thu, 23 Mar 2017 12:09:35 -0700 Subject: [PATCH] Fix displayLevel redefinition issues --- programs/util.h | 8 ++++---- programs/zstdcli.c | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/programs/util.h b/programs/util.h index e0b705117..9d23cbb8e 100644 --- a/programs/util.h +++ b/programs/util.h @@ -285,6 +285,10 @@ UTIL_STATIC void *UTIL_realloc(void *ptr, size_t size) return NULL; } +static int g_utilDisplayLevel; +#define UTIL_DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define UTIL_DISPLAYLEVEL(l, ...) { if (g_utilDisplayLevel>=l) { UTIL_DISPLAY(__VA_ARGS__); } } + #ifdef _WIN32 # define UTIL_HAS_CREATEFILELIST @@ -352,10 +356,6 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ # include /* opendir, readdir */ # include /* strerror, memcpy */ -static int g_displayLevel; -#define UTIL_DISPLAY(...) fprintf(stderr, __VA_ARGS__) -#define UTIL_DISPLAYLEVEL(l, ...) { if (g_displayLevel>=l) { UTIL_DISPLAY(__VA_ARGS__); } } - UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_t* pos, char** bufEnd, int followLinks) { DIR *dir; diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 38b8394a0..4d7fbb357 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -583,6 +583,7 @@ int main(int argCount, const char* argv[]) #endif + g_utilDisplayLevel = g_displayLevel; if (!followLinks) { unsigned u; for (u=0, fileNamesNb=0; u