From: Mark Adler Date: Wed, 29 Jul 2015 05:44:31 +0000 (-0700) Subject: Avoid use of DEBUG macro -- change to ZLIB_DEBUG. X-Git-Tag: 1.9.9-b1~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23b4bb3ec41db70b705a1c1e9e1cde72f9bac467;p=thirdparty%2Fzlib-ng.git Avoid use of DEBUG macro -- change to ZLIB_DEBUG. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a099b6cc8..a6dec89e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,6 +112,8 @@ if(HAVE_BUILTIN_CTZL) add_definitions(-DHAVE_BUILTIN_CTZL) endif() +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DZLIB_DEBUG") + if(MSVC) set(CMAKE_DEBUG_POSTFIX "d") add_definitions(-D_CRT_SECURE_NO_DEPRECATE) diff --git a/Makefile.in b/Makefile.in index ae7044d11..f8bf80719 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,7 @@ CC=cc CFLAGS=-O #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 -#CFLAGS=-g -DDEBUG +#CFLAGS=-g -DZLIB_DEBUG #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ # -Wstrict-prototypes -Wmissing-prototypes diff --git a/arch/x86/deflate_quick.c b/arch/x86/deflate_quick.c index 6fc5136ea..222f39e8e 100644 --- a/arch/x86/deflate_quick.c +++ b/arch/x86/deflate_quick.c @@ -19,7 +19,7 @@ #endif #include "deflate.h" -#ifdef DEBUG +#ifdef ZLIB_DEBUG #include #endif diff --git a/deflate.c b/deflate.c index ee803bc8e..e28a9a806 100644 --- a/deflate.c +++ b/deflate.c @@ -1125,7 +1125,7 @@ static void lm_init(deflate_state *s) { s->ins_h = 0; } -#ifdef DEBUG +#ifdef ZLIB_DEBUG #define EQUAL 0 /* result of memcmp for equal strings */ @@ -1150,7 +1150,7 @@ void check_match(deflate_state *s, IPos start, IPos match, int length) { } #else # define check_match(s, start, match, length) -#endif /* DEBUG */ +#endif /* ZLIB_DEBUG */ /* =========================================================================== * Fill the window when the lookahead becomes insufficient. @@ -1576,7 +1576,7 @@ static block_state deflate_huff(deflate_state *s, int flush) { return block_done; } -#ifdef DEBUG +#ifdef ZLIB_DEBUG /* =========================================================================== * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. diff --git a/deflate.h b/deflate.h index 8f96203b4..7266e53ff 100644 --- a/deflate.h +++ b/deflate.h @@ -261,7 +261,7 @@ typedef struct internal_state { unsigned int matches; /* number of string matches in current block */ unsigned int insert; /* bytes at end of window left to insert */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG unsigned long compressed_len; /* total bit length of compressed file mod 2^32 */ unsigned long bits_sent; /* bit length of compressed data sent mod 2^32 */ #endif @@ -349,7 +349,7 @@ void ZLIB_INTERNAL bi_windup(deflate_state *s); * used. */ -#ifndef DEBUG +#ifndef ZLIB_DEBUG /* Inline versions of _tr_tally for speed: */ # if defined(GEN_TREES_H) @@ -413,11 +413,11 @@ void ZLIB_INTERNAL bi_windup(deflate_state *s); # define UPDATE_HASH(s, h, i) (h = (((h) << s->hash_shift) ^ (s->window[i + (MIN_MATCH-1)])) & s->hash_mask) #endif -#ifndef DEBUG +#ifndef ZLIB_DEBUG # define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) /* Send a code of the given tree. c and tree must not have side effects */ -#else /* DEBUG */ +#else /* ZLIB_DEBUG */ # define send_code(s, c, tree) \ { if (z_verbose > 2) { \ fprintf(stderr, "\ncd %3d ", (c)); \ @@ -426,7 +426,7 @@ void ZLIB_INTERNAL bi_windup(deflate_state *s); } #endif -#ifdef DEBUG +#ifdef ZLIB_DEBUG void send_bits(deflate_state *s, int value, int length); #else #define send_bits(s, value, length) \ diff --git a/deflate_p.h b/deflate_p.h index 6c9957a66..3550818aa 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -15,7 +15,7 @@ /* Forward declare common non-inlined functions declared in deflate.c */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG void check_match(deflate_state *s, IPos start, IPos match, int length); #else #define check_match(s, start, match, length) diff --git a/treebuild.xml b/treebuild.xml index 38d29d75e..34a4f779a 100644 --- a/treebuild.xml +++ b/treebuild.xml @@ -101,7 +101,7 @@