Zlib-ng can be used/compiled in two different modes, that require some consideration by the application developer.
Zlib-ng can be compiled in zlib-compat mode, suitable for zlib-replacement in a single application or system-wide.
Please note that zlib-ng in zlib-compat mode tries to maintain both API and ABI compatibility with the original zlib. Any issues regarding compatibility can be reported as bugs.
In certain instances you may not be able to simply replace the zlib library/dll files and expect the application to work. The application may need to be recompiled against the zlib-ng headers and libs to ensure full compatibility.
It is also possible for the deflate output stream to differ from the original zlib due to algorithmic differences between the two libraries. Any tests or applications that depend on the exact length of the deflate stream being a certain value will need to be updated.
Advantages:
Disadvantages:
Build Considerations:
z_size_t
is unsigned __int64 on 64-bit Windows, and unsigned long on 32-bit Windows, Unix and macOSz_uintmax_t
is unsigned long in zlib-compat mode, and size_t with zlib-ng APIZlib-ng in native mode is suitable for co-existing with the standard zlib library, allowing applications to implement support and testing separately.
The zlib-ng native has implemented some modernization and simplifications in its API, intended to make life easier for application developers.
Advantages:
Disadvantages:
zng_
has to be added.Build Considerations:
z_size_t
is size_tTo distinguish zlib-ng from other zlib implementations at compile-time check for the existence of ZLIBNG_VERSION
defined in the zlib header.