From f1ec86a371eee29a678b247c226dca388ad73646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 1 Aug 2023 15:15:54 +0800 Subject: [PATCH] IO: only suppress IO in release mode It can be annoy when printing debug messages --- src/common/io/io.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/io/io.h b/src/common/io/io.h index cfe730550..aff080dc8 100644 --- a/src/common/io/io.h +++ b/src/common/io/io.h @@ -96,7 +96,11 @@ static inline void ffUnsuppressIO(bool* suppressed) *suppressed = false; } -#define FF_SUPPRESS_IO() bool __attribute__((__cleanup__(ffUnsuppressIO), __unused__)) io_suppressed__ = ffSuppressIO(true) +#ifdef NDEBUG + #define FF_SUPPRESS_IO() bool __attribute__((__cleanup__(ffUnsuppressIO), __unused__)) io_suppressed__ = ffSuppressIO(true) +#else + #define FF_SUPPRESS_IO() +#endif void ffListFilesRecursively(const char* path);