compat.gzip-hpp
#includegzip-hpp — header-only gzip/deflate compression wrappers over zlib
#include <gzip/compress.hpp>
mcpp add compat.gzip-hpp@0.1.0
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// 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 · 專案 tests/examples/gzip-hpp
openkal
| 目標 | 結果 | 環境 | 測試專案 | 首條診斷 |
|---|---|---|---|---|
| x86_64-linux-gnu | runs | posix | gzip-hpp | |
| x86_64-windows-musl | runs | posix | gzip-hpp |
測量方式
2026-09-23 由 tests/openkal/compat.py 測得,使用 openkal-llvm-runtime 0.15.1、llvm@22.1.8、mcpp 2026.9.21.3。測試專案沒有自行選擇平台相依。 上方徽章是所有已測目標裡最嚴格那個的結果 —— 上表列出每個目標各自的環境。
建置
- targets
gzip_hpp (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
mcpp_generated, */include
原始檔 (1)
mcpp_generated/gzip_hpp_anchor.c
產生的檔案
mcpp_generated/gzip/utils.hppmcpp_generated/gzip/config.hppmcpp_generated/gzip_hpp_anchor.c