summaryrefslogtreecommitdiff
path: root/lib/zstd/common/debug.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-03-26 21:35:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-03-26 21:35:28 -0700
commite61f33273ca755b3e2ebee4520a76097199dc7a8 (patch)
tree969db95c82c606fcd9926b3d7625c009951d08c9 /lib/zstd/common/debug.h
parent592329e5e94e26080f4815c6cc6cd0f487a91064 (diff)
parent65d1f5507ed2c78c64fce40e44e5574a9419eb09 (diff)
Merge tag 'zstd-linus-v6.15-rc1' of https://github.com/terrelln/linux
Pull zstd updates from Nick Terrell: "Update zstd to the latest upstream release v1.5.7. The two major motivations for updating Zstandard are to keep the code up to date, and to expose API's needed by Intel for the QAT compression accelerator. Imported cleanly from the upstream tag v1.5.7-kernel, which is signed by upstream's signing key EF8FE99528B52FFD" Link: https://github.com/facebook/zstd/releases/tag/v1.5.7 Link: https://github.com/facebook/zstd/releases/tag/v1.5.7-kernel Link: https://keyserver.ubuntu.com/pks/lookup?search=EF8FE99528B52FFD&fingerprint=on&op=index * tag 'zstd-linus-v6.15-rc1' of https://github.com/terrelln/linux: zstd: Import upstream v1.5.7
Diffstat (limited to 'lib/zstd/common/debug.h')
-rw-r--r--lib/zstd/common/debug.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/lib/zstd/common/debug.h b/lib/zstd/common/debug.h
index 6dd88d1fbd02c..c8a10281f112e 100644
--- a/lib/zstd/common/debug.h
+++ b/lib/zstd/common/debug.h
@@ -1,7 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
/* ******************************************************************
* debug
* Part of FSE library
- * Copyright (c) Yann Collet, Facebook, Inc.
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
*
* You can contact the author at :
* - Source repository : https://github.com/Cyan4973/FiniteStateEntropy
@@ -33,7 +34,6 @@
#define DEBUG_H_12987983217
-
/* static assert is triggered at compile time, leaving no runtime artefact.
* static assert only works with compile-time constants.
* Also, this variant can only be used inside a function. */
@@ -82,20 +82,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
-
-
#endif /* DEBUG_H_12987983217 */