compat.zlib-ng
#includezlib-ng in its zlib-compatible form: zlib's API with vectorised inflate, adler32 and deflate
#include <zlib.h>
mcpp add compat.zlib-ng@2.3.3
Usage
From this repository's own test project — built and run by CI, not written for the website.
// compat.zlib-ng: zlib's interface, madler's streams, and agreement between the
// library and its consumer.
#include <zlib.h>
#include <cstdio>
#include <cstring>
#include <string>
namespace {
int failures = 0;
void check(bool held, const char* what) {
if (!held) { std::printf("FAIL: %s\n", what); ++failures; }
}
// zlibCompileFlags() bits 6 and 7 state the size of z_off_t the library was
// compiled with: 0 is 2 bytes, 1 is 4, 2 is 8, 3 is another size.
unsigned long library_off_t_size() {
switch ((zlibCompileFlags() >> 6) & 3u) {
case 0: return 2;
case 1: return 4;
// …
tests/examples/zlib-ng/tests/zlib-ng.cpp · project tests/examples/zlib-ng
openkal
| target | result | environment | test project | first diagnostic |
|---|---|---|---|---|
| aarch64-linux-musl | runs | posix | zlib-ng | |
| x86_64-linux-gnu | runs | posix | zlib-ng | |
| x86_64-linux-musl | runs | posix | zlib-ng | |
| x86_64-windows-musl | fails | zlib-ng | error: openkal-llvm-runtime is requested as '0.15.2' by zlib-ng-tests, and the platform openkal-platform 0.32.1 is a version group |
How this was measured
Measured 2026-11-29 by tests/openkal/compat.py with openkal-llvm-runtime 0.15.2, llvm@22.1.8, mcpp 2026.11.23.1. The test project selects no platform dependency of its own. The badge above is a summary of the strictest measured target -- the table above states each target's own environment.
Build
- targets
zlib (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*, mcpp_generated/include
Sources (40)
*/adler32.c*/compress.c*/crc32.c*/crc32_braid_comb.c*/deflate.c*/deflate_fast.c*/deflate_huff.c*/deflate_medium.c*/deflate_quick.c*/deflate_rle.c*/deflate_slow.c*/deflate_stored.c*/functable.c*/gzlib.c*/gzread.c*/gzwrite.c*/infback.c*/inflate.c*/inftrees.c*/insert_string.c*/insert_string_roll.c*/trees.c*/uncompr.c*/zutil.c*/arch/generic/adler32_c.c*/arch/generic/adler32_fold_c.c*/arch/generic/chunkset_c.c*/arch/generic/compare256_c.c*/arch/generic/crc32_braid_c.c*/arch/generic/crc32_chorba_c.c*/arch/generic/crc32_fold_c.c*/arch/generic/slide_hash_c.c*/arch/arm/adler32_neon.c*/arch/arm/chunkset_neon.c*/arch/arm/compare256_neon.c*/arch/arm/slide_hash_neon.c*/arch/x86/chorba_sse2.c*/arch/x86/chunkset_sse2.c*/arch/x86/compare256_sse2.cmcpp_generated/slide_hash_sse2.c
Generated files
mcpp_generated/slide_hash_sse2.cmcpp_generated/include/mcpp_zlibng_config.h