compat.yyjson
#includeFastest C JSON library with SIMD — ANSI C, zero dependencies
#include "yyjson.h"
mcpp add compat.yyjson@0.13.0
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// Smoke test — verify compat.yyjson builds, links, and works
#include "yyjson.h"
import std;
int main() {
const char* json = R"({"name":"mcpp","version":"0.12.0"})";
yyjson_doc* doc = yyjson_read(json, strlen(json), 0);
if (!doc) return 1;
auto* root = yyjson_doc_get_root(doc);
auto* name = yyjson_obj_get(root, "name");
if (!name || std::string_view{yyjson_get_str(name)} != "mcpp") return 2;
std::println("compat.yyjson smoke test: ok");
yyjson_doc_free(doc);
return 0;
}
tests/examples/yyjson/tests/parse.cpp · 專案 tests/examples/yyjson
openkal
| 目標 | 結果 | 環境 | 測試專案 | 首條診斷 |
|---|---|---|---|---|
| x86_64-linux-gnu | runs | posix | yyjson | |
| x86_64-windows-musl | runs | posix | yyjson |
測量方式
2026-09-23 由 tests/openkal/compat.py 測得,使用 openkal-llvm-runtime 0.15.1、llvm@22.1.8、mcpp 2026.9.21.3。測試專案沒有自行選擇平台相依。 上方徽章是所有已測目標裡最嚴格那個的結果 —— 上表列出每個目標各自的環境。
建置
- targets
yyjson (lib)- language
c++23- C standard
c99- import std
- no
- include dirs
*/src
原始檔 (1)
*/src/yyjson.c