mcpp index

compat.gzip-hpp

#include

gzip-hpp — header-only gzip/deflate compression wrappers over zlib

#include <gzip/compress.hpp>
mcpp add compat.gzip-hpp@0.1.0

Usage

From this repository's own test project — built and run by CI, not written for the website.

// Behavioral test — compat.gzip-hpp compresses and decompresses through zlib.
//
// Round-trip alone would pass on a library that did nothing, so the test also
// asserts the gzip MAGIC on the compressed bytes and that a compressible
// payload actually shrinks. Both are answers only real deflate can give.
//
// It is also the link-time proof for the package's zlib dependency: every
// function called here bottoms out in `deflate`/`inflate`.
#include <gzip/compress.hpp>
#include <gzip/decompress.hpp>
#include <gzip/utils.hpp>

#include <cstdio>
#include <string>

int main() {
    std::string original;
    for (int i = 0; i < 200; ++i) original += "mcpp-index gzip round trip ";

    const std::string compressed = gzip::compress(original.data(), original.size());

    if (!gzip::is_compressed(compressed.data(), compressed.size())) {
// …

tests/examples/gzip-hpp/tests/roundtrip.cpp · project tests/examples/gzip-hpp

openkal

targetresultenvironmenttest projectfirst diagnostic
x86_64-linux-gnurunsposixgzip-hpp
x86_64-windows-muslrunsposixgzip-hpp

How this was measured

Measured 2026-09-23 by tests/openkal/compat.py with openkal-llvm-runtime 0.15.1, llvm@22.1.8, mcpp 2026.9.21.3. 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
gzip_hpp (lib)
language
c++23
C standard
c11
import std
no
include dirs
mcpp_generated, */include

Sources (1)

  • mcpp_generated/gzip_hpp_anchor.c

Generated files

  • mcpp_generated/gzip/utils.hpp
  • mcpp_generated/gzip/config.hpp
  • mcpp_generated/gzip_hpp_anchor.c

Versions

VersionPlatforms Mirrorssha256
0.1.0 latest LinuxWindowsmacOS CN GLOBAL 7ce3908cd13f…