compat.libpng
#includePNG reference library — portable PNG encode/decode (depends on zlib)
#include "png.h"
mcpp add compat.libpng@1.6.59
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// Smoke test — verify compat.libpng builds, links, and basic API works
#include "png.h"
import std;
int main() {
auto* png = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!png) return 1;
auto* info = png_create_info_struct(png);
if (!info) { png_destroy_read_struct(&png, nullptr, nullptr); return 2; }
std::println("compat.libpng smoke test: ok");
png_destroy_read_struct(&png, &info, nullptr);
return 0;
}
tests/examples/libpng/tests/read.cpp · 專案 tests/examples/libpng
openkal
| 目標 | 結果 | 環境 | 測試專案 | 首條診斷 |
|---|---|---|---|---|
| x86_64-linux-gnu | runs | posix | libpng | |
| x86_64-windows-musl | runs | posix | libpng |
測量方式
2026-09-23 由 tests/openkal/compat.py 測得,使用 openkal-llvm-runtime 0.15.1、llvm@22.1.8、mcpp 2026.9.21.3。測試專案沒有自行選擇平台相依。 上方徽章是所有已測目標裡最嚴格那個的結果 —— 上表列出每個目標各自的環境。
建置
- targets
libpng (lib)- language
c++23- C standard
c99- import std
- no
- include dirs
*, mcpp_generated
原始檔 (15)
*/png.c*/pngerror.c*/pngget.c*/pngmem.c*/pngpread.c*/pngread.c*/pngrio.c*/pngrtran.c*/pngrutil.c*/pngset.c*/pngtrans.c*/pngwio.c*/pngwrite.c*/pngwtran.c*/pngwutil.c
產生的檔案
mcpp_generated/pnglibconf.h