mcpp index

gnome.glib

import

GLib 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

版本

版本平台 鏡像sha256
2.82.5 最新 Linux GLOBAL CN 38a175bcd889…