summaryrefslogtreecommitdiffstats
path: root/lib/lz4.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 93de1e5..87ec6ab 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -280,10 +280,22 @@ static const int LZ4_minLength = (MFLIMIT+1);
/*-************************************
-* Common Utils
+* Error detection
**************************************/
#define LZ4_STATIC_ASSERT(c) { enum { LZ4_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */
+#if defined(LZ4_DEBUG) && (LZ4_DEBUG>=2)
+# include <stdio.h>
+# define DEBUGLOG(l, ...) { \
+ if (l<=LZ4_DEBUG) { \
+ fprintf(stderr, __FILE__ ": "); \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, " \n"); \
+ } }
+#else
+# define DEBUGLOG(l, ...) {} /* disabled */
+#endif
+
/*-************************************
* Common functions