gnome.glib
importGLib 2.82.5 — data structures, the main loop, Unicode, GVariant and GRegex
import gnome.glib;
#include <glib.h>
模块名取自本索引给这个包写的测试项目。
mcpp add gnome.glib@2.82.5
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// ⭐ THE MODULE, WHICH IS WHAT THE NAMESPACE PROMISES.
//
// In this index the namespace is the contract: `compat.xxx` is consumed with
// `#include`, an owner namespace like `gnome.xxx` exposes `import`. glib.cpp
// next to this file takes the header route; this one takes the module, so both
// doors are tested rather than assumed.
//
// ─────────────────────────────────────────────────────────────────────────
// ⚠️ THE TWO DOORS DO NOT COMPOSE, AND THAT IS GCC'S RULE, NOT A CHOICE HERE.
//
// A TU that imports gnome.glib AND textually includes a glib header reaches
// `<time.h>` twice — once through the module's global fragment, once directly
// — and the same `struct tm` from the same file becomes two entities:
//
// error: conflicting declaration 'struct tm'
// note: previous declaration as 'struct tm' (of module gnome.glib)
//
// repeated for every type in it. So a consumer picks ONE route.
//
// WHAT THAT MEANS IN PRACTICE, stated plainly because it decides which route
// to pick: a module cannot carry macros, and glib's macros are half its API
// (1,337 `#define` against 1,312 declarations; for gio 1,679 against 1,753).
// …
tests/examples/glib/tests/module.cpp · 项目 tests/examples/glib
构建 · 上游清单
- targets
glib-2_0 (lib), glib (lib)- language
c++23- manifest version
2.82.5- dependencies
compat- 来源
https://raw.githubusercontent.com/mcpplibs/glib/2.82.5/mcpp/glib/mcpp.toml