From 71cad090cfd6251b2181bd4c2134b39b729a82de Mon Sep 17 00:00:00 2001 From: ddidderr Date: Tue, 21 Jul 2026 08:53:13 +0200 Subject: [PATCH] fix(compress): gate MT frame callback by build feature The MT frame-progression callback is only referenced when ZSTD_MULTITHREAD is enabled. Keep its definition under the same configuration guard so single-threaded library, test, and decode-corpus builds do not report an unused static function while the MT callback remains available to the Rust dispatch bridge. Test Plan: - git diff --cached --check - Capped full tests passed before this warning-only guard - Capped native rebuild and smoke rerun pending --- lib/compress/zstd_compress.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index ea87b4061..7beab6017 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -4439,15 +4439,12 @@ size_t ZSTD_estimateCStreamSize(int compressionLevel) * tells how much data has been consumed (input) and produced (output) for current frame. * able to count progression inside worker threads (non-blocking mode). */ -static ZSTD_frameProgression ZSTD_rust_frameProgression_MT(void* context) -{ #ifdef ZSTD_MULTITHREAD +# static ZSTD_frameProgression ZSTD_rust_frameProgression_MT(void* context) +{ return ZSTDMT_getFrameProgression((ZSTDMT_CCtx*)context); -#else - (void)context; - return (ZSTD_frameProgression){ 0 }; -#endif } +#endif ZSTD_frameProgression ZSTD_getFrameProgression(const ZSTD_CCtx* cctx) {