Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ZSTD_LEGACY_SUPPORT=5 in "make test" #3943

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/legacy/zstd_v02.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ extern "C" {
* Streaming functions
***************************************/

typedef struct ZSTD_DCtx_s ZSTD_DCtx;
typedef struct ZSTDv02_Dctx_s ZSTD_DCtx;

/*
Use above functions alternatively.
Expand Down Expand Up @@ -2737,7 +2737,7 @@ static unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
/* *************************************************************
* Decompression section
***************************************************************/
struct ZSTD_DCtx_s
struct ZSTDv02_Dctx_s
{
U32 LLTable[FSE_DTABLE_SIZE_U32(LLFSELog)];
U32 OffTable[FSE_DTABLE_SIZE_U32(OffFSELog)];
Expand Down
4 changes: 2 additions & 2 deletions lib/legacy/zstd_v03.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ extern "C" {
* Streaming functions
***************************************/

typedef struct ZSTD_DCtx_s ZSTD_DCtx;
typedef struct ZSTDv03_Dctx_s ZSTD_DCtx;

/*
Use above functions alternatively.
Expand Down Expand Up @@ -2377,7 +2377,7 @@ static unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
/* *************************************************************
* Decompression section
***************************************************************/
struct ZSTD_DCtx_s
struct ZSTDv03_Dctx_s
{
U32 LLTable[FSE_DTABLE_SIZE_U32(LLFSELog)];
U32 OffTable[FSE_DTABLE_SIZE_U32(OffFSELog)];
Expand Down
27 changes: 18 additions & 9 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# zstreamtest32: Same as zstreamtest, but forced to compile in 32-bits mode
# ##########################################################################

ZSTD_LEGACY_SUPPORT ?= 0
ZSTD_LEGACY_SUPPORT ?= 5

DEBUGLEVEL ?= 2
export DEBUGLEVEL # transmit value to sub-makefiles
Expand All @@ -33,28 +33,31 @@ PYTHON ?= python3
TESTARTEFACT := versionsTest

DEBUGFLAGS += -g -Wno-c++-compat
CPPFLAGS += -I$(LIB_SRCDIR) -I$(LIB_SRCDIR)/common -I$(LIB_SRCDIR)/compress \
CPPFLAGS += -I$(LIB_SRCDIR) -I$(LIB_SRCDIR)/common -I$(LIB_SRCDIR)/compress -I$(LIB_SRCDIR)/legacy \
-I$(LIB_SRCDIR)/dictBuilder -I$(LIB_SRCDIR)/deprecated -I$(PRGDIR) \
-DZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY=1

ZSTDCOMMON_FILES := $(sort $(ZSTD_COMMON_FILES))
ZSTDCOMP_FILES := $(sort $(ZSTD_COMPRESS_FILES))
ZSTDDECOMP_FILES := $(sort $(ZSTD_DECOMPRESS_FILES))
ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
ZSTDLEGACY_FILES := $(sort $(wildcard $(LIB_SRCDIR)/legacy/*.c))
ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) $(ZSTDLEGACY_FILES)
ZDICT_FILES := $(sort $(ZSTD_DICTBUILDER_FILES))

ZSTD_F1 := $(sort $(wildcard $(ZSTD_FILES)))
ZSTD_OBJ1 := $(subst $(LIB_SRCDIR)/common/,zstdm_,$(ZSTD_F1))
ZSTD_OBJ2 := $(subst $(LIB_SRCDIR)/compress/,zstdc_,$(ZSTD_OBJ1))
ZSTD_OBJ3 := $(subst $(LIB_SRCDIR)/decompress/,zstdd_,$(ZSTD_OBJ2))
ZSTD_OBJ4 := $(ZSTD_OBJ3:.c=.o)
ZSTD_OBJECTS := $(ZSTD_OBJ4:.S=.o)
ZSTD_OBJ4 := $(subst $(LIB_SRCDIR)/legacy/,zstdl_,$(ZSTD_OBJ3))
ZSTD_OBJ5 := $(ZSTD_OBJ4:.c=.o)
ZSTD_OBJECTS := $(ZSTD_OBJ5:.S=.o)

ZSTDMT_OBJ1 := $(subst $(LIB_SRCDIR)/common/,zstdmt_m_,$(ZSTD_F1))
ZSTDMT_OBJ2 := $(subst $(LIB_SRCDIR)/compress/,zstdmt_c_,$(ZSTDMT_OBJ1))
ZSTDMT_OBJ3 := $(subst $(LIB_SRCDIR)/decompress/,zstdmt_d_,$(ZSTDMT_OBJ2))
ZSTDMT_OBJ4 := $(ZSTDMT_OBJ3:.c=.o)
ZSTDMT_OBJECTS := $(ZSTDMT_OBJ4:.S=.o)
ZSTDMT_OBJ4 := $(subst $(LIB_SRCDIR)/legacy/,zstdmt_l_,$(ZSTDMT_OBJ3))
ZSTDMT_OBJ5 := $(ZSTDMT_OBJ4:.c=.o)
ZSTDMT_OBJECTS := $(ZSTDMT_OBJ5:.S=.o)

# Define *.exe as extension for Windows systems
ifneq (,$(filter Windows%,$(OS)))
Expand Down Expand Up @@ -118,6 +121,9 @@ zstdd_%.o : $(LIB_SRCDIR)/decompress/%.c
zstdd_%.o : $(LIB_SRCDIR)/decompress/%.S
$(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@

zstdl_%.o : $(LIB_SRCDIR)/legacy/%.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@

zstdmt%.o : CPPFLAGS += $(MULTITHREAD_CPP)

zstdmt_m_%.o : $(LIB_SRCDIR)/common/%.c
Expand All @@ -132,6 +138,9 @@ zstdmt_d_%.o : $(LIB_SRCDIR)/decompress/%.c
zstdmt_d_%.o : $(LIB_SRCDIR)/decompress/%.S
$(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@

zstdmt_l_%.o : $(LIB_SRCDIR)/legacy/%.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@

FULLBENCHS := fullbench fullbench32
CLEAN += $(FULLBENCHS)
fullbench32: CPPFLAGS += -m32
Expand Down Expand Up @@ -222,8 +231,8 @@ CLEAN += invalidDictionaries
invalidDictionaries : $(ZSTD_OBJECTS) invalidDictionaries.c

CLEAN += legacy
legacy : CPPFLAGS += -I$(LIB_SRCDIR)/legacy -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=4
legacy : $(ZSTD_FILES) $(sort $(wildcard $(LIB_SRCDIR)/legacy/*.c)) legacy.c
legacy : CPPFLAGS += -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=4
legacy : $(ZSTD_FILES) legacy.c

CLEAN += decodecorpus
decodecorpus : LDLIBS += -lm
Expand Down