diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2015-05-11 15:55:42 +0200 |
---|---|---|
committer | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2015-05-12 11:26:30 +0200 |
commit | b3dca09caf3350d711066c85ef0101628ed0947c (patch) | |
tree | d58bf27f914cf9b5874942d641a25c7caf107f37 /test/example.c | |
parent | 7776efc81ba38e4877344ce75174a03b0fdf8057 (diff) |
Remove support for compiling with Z_SOLO.
Make compiling without gzip file operation support the default
(define WITH_GZFILEOP or use --zlib-compat to enable them).
Add initial support for compiling in a zlib-compatible mode, this currently only
enables gzip file operations and sets the ZLIB_COMPAT flag.
Conflicts:
test/minigzip.c
Diffstat (limited to 'test/example.c')
-rw-r--r-- | test/example.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/test/example.c b/test/example.c index 50fc370..15bf810 100644 --- a/test/example.c +++ b/test/example.c @@ -39,35 +39,11 @@ void test_dict_inflate (Byte *compr, uLong comprLen, Byte *uncompr, uLong uncom int main (int argc, char *argv[]); -#ifdef Z_SOLO - -void *myalloc (void *, unsigned, unsigned); -void myfree (void *, void *); - -void *myalloc(void *q, unsigned n, unsigned m) -{ - q = Z_NULL; - return calloc(n, m); -} - -void myfree(void *q, void *p) -{ - q = Z_NULL; - free(p); -} - -static alloc_func zalloc = myalloc; -static free_func zfree = myfree; - -#else /* !Z_SOLO */ - static alloc_func zalloc = (alloc_func)0; static free_func zfree = (free_func)0; void test_compress (Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen); -void test_gzio (const char *fname, - Byte *uncompr, uLong uncomprLen); /* =========================================================================== * Test compress() and uncompress() @@ -93,6 +69,10 @@ void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) } } +#ifdef WITH_GZFILEOP +void test_gzio (const char *fname, + Byte *uncompr, uLong uncomprLen); + /* =========================================================================== * Test read/write of .gz files */ @@ -174,7 +154,7 @@ void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) #endif } -#endif /* Z_SOLO */ +#endif /* WITH_GZFILEOP */ /* =========================================================================== * Test deflate() with small buffers @@ -536,11 +516,9 @@ int main(int argc, char *argv[]) exit(1); } -#ifdef Z_SOLO - argc = strlen(argv[0]); -#else test_compress(compr, comprLen, uncompr, uncomprLen); +#ifdef WITH_GZFILEOP test_gzio((argc > 1 ? argv[1] : TESTFILE), uncompr, uncomprLen); #endif |