void* ZSTD_defaultAllocFunction(void* opaque, size_t size);
void ZSTD_defaultFreeFunction(void* opaque, void* address);
static ZSTD_customMem const defaultCustomMem = { ZSTD_defaultAllocFunction, ZSTD_defaultFreeFunction, NULL };
-
+static ZSTD_customMem const defaultCustomNULL = { NULL, NULL, NULL };
+
#endif /* ZSTD_CCOMMON_H_MODULE */
ZBUFF_CCtx* ZBUFF_createCCtx(void)
{
- ZSTD_customMem const customMem = { NULL, NULL, NULL };
- return ZBUFF_createCCtx_advanced(customMem);
+ return ZBUFF_createCCtx_advanced(defaultCustomNULL);
}
ZBUFF_CCtx* ZBUFF_createCCtx_advanced(ZSTD_customMem customMem)
ZSTD_CCtx* ZSTD_createCCtx(void)
{
- ZSTD_customMem const customMem = { NULL, NULL, NULL };
- return ZSTD_createCCtx_advanced(customMem);
+ return ZSTD_createCCtx_advanced(defaultCustomNULL);
}
ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
ZBUFF_DCtx* ZBUFF_createDCtx(void)
{
- ZSTD_customMem const customMem = { NULL, NULL, NULL };
- return ZBUFF_createDCtx_advanced(customMem);
+ return ZBUFF_createDCtx_advanced(defaultCustomNULL);
}
ZBUFF_DCtx* ZBUFF_createDCtx_advanced(ZSTD_customMem customMem)
ZSTD_DCtx* ZSTD_createDCtx(void)
{
- ZSTD_customMem const customMem = { NULL, NULL, NULL };
- return ZSTD_createDCtx_advanced(customMem);
+ return ZSTD_createDCtx_advanced(defaultCustomNULL);
}
U32 mainPause = 0;
const char* programName = argv[0];
ZSTD_customMem customMem = { ZBUFF_allocFunction, ZBUFF_freeFunction, NULL };
- ZSTD_customMem customNULL = { NULL, NULL, NULL };
/* Check command line */
for(argNb=1; argNb<argc; argNb++) {
if (nbTests<=0) nbTests=1;
if (testNb==0) {
- result = basicUnitTests(0, ((double)proba) / 100, customNULL); /* constant seed for predictability */
+ result = basicUnitTests(0, ((double)proba) / 100, defaultCustomNULL); /* constant seed for predictability */
if (!result) {
DISPLAYLEVEL(4, "Unit tests using customMem :\n")
result = basicUnitTests(0, ((double)proba) / 100, customMem); /* use custom memory allocation functions */
# Paths to static and dynamic zlib and zstd libraries
-ifneq (,$(filter Windows%,$(OS)))
-ZLIBDIR = ../../zlib1.2.8
+# Use "make ZLIBDIR=path/to/zlib" to select a path to library
+ifdef ZLIBDIR
STATICLIB = $(ZLIBDIR)/libz.a ../lib/libzstd.a
IMPLIB = $(ZLIBDIR)/libz.dll.a ../lib/libzstd.a
else