If adding system.zlib to the two function names, all compiles ok
procedure TXDataCompressionStream.Flush;
begin
FZStream.next_in := nil;
FZStream.avail_in := 0;
try
if FStream.Position <> FStreamPos then FStream.Position := FStreamPos;
while ZCompressCheckWithoutBufferError(system.ZLib.deflate(FZStream, Z_FINISH)) <> Z_STREAM_END do
begin
FStream.WriteBuffer(FBuffer, Length(FBuffer) - Integer(FZStream.avail_out));
FZStream.next_out := @FBuffer[0];
FZStream.avail_out := Length(FBuffer);
end;
if Integer(FZStream.avail_out) < Length(FBuffer) then
begin
FStream.WriteBuffer(FBuffer, Length(FBuffer) - Integer(FZStream.avail_out));
end;
finally
system.ZLib.deflateEnd(FZStream);
end;
end;