zlib-ng: Problems with integration zlib-ng to lzbench
Hello!
I’m trying to integrate zlib-ng
to lzbench
in my https://github.com/inikep/lzbench/pull/100 PR.
And got this error:
In file included from _lzbench/compressors.cpp:1526: ././zlib-ng/zlib-ng.h:1076:20: error: conflicting declaration ‘typedef uint32_t (* in_func)(void*, const uint8_t**)’ 1076 | typedef uint32_t (in_func) (void , const uint8_t * ); | ^~~~~~~ In file included from _lzbench/compressors.cpp:1502: ././zlib/zlib.h:1092:20: note: previous declaration as ‘typedef unsigned int ( in_func)(void, unsigned char*)’ 1092 | typedef unsigned (*in_func) OF((void FAR *, | ^~~~~~~
Any help is very appreciated!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (7 by maintainers)
@data-man The problem here is that in your wrappers you convert
size_t
touLongf
before calling zlib-ng. This was required by zlib, but zlib-ng in native mode uses the modernsize_t
instead.@data-man This is also caused by using wrong header file. zlib-ng deprecated support for FAR specifier for pointers at early stage, so it is never used in its own headers
Yeah, that is what I thought. So if we do want to change this, it would have to be for the next stable branch, not the 2.0 one.
We should make a complete list so we can decide whether it is worth changing.
A workaround for this case would be either don’t compile zlib and zlib-ng at the same time, or you could try moving the zlib-ng include and wrappers into a separate compile unit (.c file)