[lib][tracing] Add ZSTD_NO_TRACE macro

When defined, it disables tracing, and avoids including the header.
This commit is contained in:
Nick Terrell
2021-03-16 11:47:27 -07:00
parent 7222614a19
commit cd1551d261
7 changed files with 11 additions and 7 deletions
+3 -1
View File
@@ -28,6 +28,7 @@ SKIPPED_FILES = [
"common/threading.c",
"common/threading.h",
"common/zstd_trace.c",
"common/zstd_trace.h",
"compress/zstdmt_compress.h",
"compress/zstdmt_compress.c",
]
@@ -658,7 +659,8 @@ def main(name, args):
raise RuntimeError(f"{name} is both defined and undefined!")
# Always set tracing to 0
if "ZSTD_TRACE" not in (arg[0] for arg in args.defs):
if "ZSTD_NO_TRACE" not in (arg[0] for arg in args.defs):
args.defs.append(("ZSTD_NO_TRACE", None))
args.defs.append(("ZSTD_TRACE", "0"))
args.replaces = parse_pair(args.replaces)