* commit second patch (from Hendi) from mantis #38930, make debug define compiling again

git-svn-id: trunk@49492 -
This commit is contained in:
marco 2021-06-08 08:58:21 +00:00
parent 4895133646
commit 6d287a8db8
6 changed files with 31 additions and 14 deletions

View File

@ -45,7 +45,7 @@ function inflate_blocks_sync_point(var s : inflate_blocks_state) : integer;
implementation
uses
infcodes, inftrees, infutil;
infcodes, inftrees, infutil{$IFDEF ZLIB_DEBUG}, SysUtils{$ENDIF};
{ Tables for deflate from PKZIP's appnote.txt. }
Const

View File

@ -31,7 +31,7 @@ procedure inflate_codes_free(var c : pInflate_codes_state;
implementation
uses
infutil, inffast;
infutil, inffast{$IFDEF ZLIB_DEBUG}, SysUtils{$ENDIF};
function inflate_codes_new (bl : cardinal;
@ -185,7 +185,7 @@ begin
if (t^.base >= $20) and (t^.base < $7f) then
Tracevv('inflate: literal '+char(t^.base))
else
Tracevv('inflate: literal '+IntToStr(t^.base));
Tracevv('inflate: literal $'+IntToHex(t^.base, 2));
{$ENDIF}
c^.mode := LIT;
continue; { break switch statement }

View File

@ -29,7 +29,7 @@ function inflate_fast( bl : cardinal;
implementation
uses
infutil;
infutil{$IFDEF ZLIB_DEBUG}, SysUtils{$ENDIF};
{ Called with number of bytes left to write in window at least 258

View File

@ -380,10 +380,6 @@ const
PRESET_DICT = $20; { preset dictionary flag in zlib header }
{$IFDEF ZLIB_DEBUG}
procedure Assert(cond : boolean; msg : string);
{$ENDIF}
procedure Trace(x : string);
procedure Tracev(x : string);
procedure Tracevv(x : string);
@ -461,12 +457,6 @@ begin
Halt(1);
end;
procedure Assert(cond : boolean; msg : string);
begin
if not cond then
z_error(msg);
end;
procedure Trace(x : string);
begin
WriteLn(x);

View File

@ -36,3 +36,9 @@
{$UNDEF MAXSEG_64K}
{$UNDEF Delphi32}
{$ENDIF}
{- $DEFINE ZLIB_DEBUG}
{$IFDEF ZLIB_DEBUG}
{$ASSERTIONS ON}
{$ENDIF}

View File

@ -1502,6 +1502,27 @@ end;
{$endif} { FASTEST }
{$ifdef ZLIB_DEBUG}
function zmemcmp(s1p, s2p : PByte; len : Cardinal) : Integer;
var
j : Cardinal;
source,
dest : PByte;
begin
source := s1p;
dest := s2p;
for j := 0 to pred(len) do
begin
if (source^ <> dest^) then
begin
zmemcmp := 2*Ord(source^ > dest^)-1;
exit;
end;
Inc(source);
Inc(dest);
end;
zmemcmp := 0;
end;
{ ===========================================================================
Check that the match at match_start is indeed a match. }