Thanks for your reply.
There is no infback.o file and linking fails.
I found a possible
workaround for 64 bit zlib:
1. In zlib files inflate.c and deflate.c remove these lines
strm->zalloc = zcalloc;
strm->zfree = zcfree;
I replaced that code with my code:
strm->zalloc = (voidpf)0;
strm->zfree = (voidpf)0;
Now linking in 64 bit fpc works fine.
2. I wrote Pascal implementation of these functions.
function zcalloc2(opaque: Pointer; items, size: Integer): Pointer;
begin
GetMem(Result, items * size);
end;
procedure zcfree2(opaque, block: Pointer);
begin
FreeMem(block);
end;
And set callbacks:
zStream.zalloc:=zcalloc2;
zFZStream.zfree:=zcfree2;
BEFORE calls to zlib functions:
deflateInit_
InflateInit_
InflateInit2_
3. My z_stream record is packed and I also had a problem with different SizeOf(z_steam) in my code and in zlib internal functions. So I also corrected zutils.h and I added 4 byte alignment:
#pragma pack(4)
before
typedef struct z_stream_s {
zlib works fine now in 64-bit fpc.
But this code now doesn't work in 32-bit fpc and zlib fails. So I compile 32 bit zlib from original sources (without my additions) and I don't set any callbacks.
I'm not sure that I did everything correctly, so any suggestions are welcome.