summaryrefslogtreecommitdiffstats
path: root/thirdparty/zstd/common/debug.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-04-05 11:22:55 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-04-05 11:22:55 +0200
commita88b4a4d56a923ad1f3652eb1133676f8c96c44d (patch)
tree0afec2e19a8bd5d95373f468da2d76dcbe56011d /thirdparty/zstd/common/debug.h
parentf6a78f83aa4b74aa5cb80ca2e3419448b1998e4f (diff)
downloadredot-engine-a88b4a4d56a923ad1f3652eb1133676f8c96c44d.tar.gz
zstd: Update to upstream version 1.5.6
Release notes: - https://github.com/facebook/zstd/releases/tag/v1.5.6
Diffstat (limited to 'thirdparty/zstd/common/debug.h')
-rw-r--r--thirdparty/zstd/common/debug.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/thirdparty/zstd/common/debug.h b/thirdparty/zstd/common/debug.h
index 0e9817ea6d..a16b69e574 100644
--- a/thirdparty/zstd/common/debug.h
+++ b/thirdparty/zstd/common/debug.h
@@ -85,18 +85,27 @@ extern int g_debuglevel; /* the variable is only declared,
It's useful when enabling very verbose levels
on selective conditions (such as position in src) */
-# define RAWLOG(l, ...) { \
- if (l<=g_debuglevel) { \
- ZSTD_DEBUG_PRINT(__VA_ARGS__); \
- } }
-# define DEBUGLOG(l, ...) { \
- if (l<=g_debuglevel) { \
- ZSTD_DEBUG_PRINT(__FILE__ ": " __VA_ARGS__); \
- ZSTD_DEBUG_PRINT(" \n"); \
- } }
+# define RAWLOG(l, ...) \
+ do { \
+ if (l<=g_debuglevel) { \
+ ZSTD_DEBUG_PRINT(__VA_ARGS__); \
+ } \
+ } while (0)
+
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+#define LINE_AS_STRING TOSTRING(__LINE__)
+
+# define DEBUGLOG(l, ...) \
+ do { \
+ if (l<=g_debuglevel) { \
+ ZSTD_DEBUG_PRINT(__FILE__ ":" LINE_AS_STRING ": " __VA_ARGS__); \
+ ZSTD_DEBUG_PRINT(" \n"); \
+ } \
+ } while (0)
#else
-# define RAWLOG(l, ...) {} /* disabled */
-# define DEBUGLOG(l, ...) {} /* disabled */
+# define RAWLOG(l, ...) do { } while (0) /* disabled */
+# define DEBUGLOG(l, ...) do { } while (0) /* disabled */
#endif