From 6761e1c949b99050f79a90a333c3432ba7cf3f22 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Thu, 20 Apr 2023 11:46:29 -0400 Subject: [PATCH] Tweak Ultra/Opt Guards --- lib/compress/zstd_opt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index 4b0fbfafe..2856398cf 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -1350,21 +1350,26 @@ _shortestPath: /* cur, last_pos, best_mlen, best_off have to be set */ /* Return the last literals size */ return (size_t)(iend - anchor); } +#endif /* build exclusions */ +#ifndef ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR static size_t ZSTD_compressBlock_opt0( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], const void* src, size_t srcSize, const ZSTD_dictMode_e dictMode) { return ZSTD_compressBlock_opt_generic(ms, seqStore, rep, src, srcSize, 0 /* optLevel */, dictMode); } +#endif +#if !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR) \ + || !defined(ZSTD_EXCLUDE_BTULTRA2_BLOCK_COMPRESSOR) static size_t ZSTD_compressBlock_opt2( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], const void* src, size_t srcSize, const ZSTD_dictMode_e dictMode) { return ZSTD_compressBlock_opt_generic(ms, seqStore, rep, src, srcSize, 2 /* optLevel */, dictMode); } -#endif /* build exclusions */ +#endif #ifndef ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR size_t ZSTD_compressBlock_btopt( @@ -1379,8 +1384,7 @@ size_t ZSTD_compressBlock_btopt( -#if !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR) \ - || !defined(ZSTD_EXCLUDE_BTULTRA2_BLOCK_COMPRESSOR) +#ifndef ZSTD_EXCLUDE_BTULTRA2_BLOCK_COMPRESSOR /* ZSTD_initStats_ultra(): * make a first compression pass, just to seed stats with more accurate starting values. * only works on first block, with no dictionary and no ldm.