You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the macros this engine defines are a module, so the rule cannot drift
`src/toolchain/predefines.cppm` is the specification and the implementation of
one thing. The contract is data in that module (`kContract`), the emission is
a function beside it (`define_tokens`), and `tests/unit/test_predefines.cpp`
asserts the two agree in BOTH directions: a macro emitted and unlisted is a
promise nobody can rely on, a row listing a macro nothing emits is one a
reader waits for forever. This wave already paid once for a rule kept in a
document while the code moved --- the reason-token table was "the four it was
missing" twice over.
GENERALISED PAST WINDOWS. `__mcpp_target_<os>__` is spelt from the triple's
own `os` field, so the ENGINE LEARNS NO OPERATING-SYSTEM NAME and a target
added to the triple parser gets its macro with no change here --- the same
discipline `[kernel-abi]` interface names follow. Measured:
`x86_64-linux-gnu` gives `__mcpp_target_linux__`, `x86_64-windows-gnu` gives
`__mcpp_target_windows__`, `riscv64-none-elf` gives `__mcpp_target_none__`.
DEFINED ALWAYS, not only where a realisation suppressed something. Conditional
emission would make its absence ambiguous: "not Windows" and "Windows, but
nothing hid its macros" would read the same, which is the shape of every
defect where a "no" and a "never asked" share a reading.
Lowercase, `__mcpp_`-prefixed. Two conventions exist --- vendor and product
names upper (`__APPLE__`, `_WIN32`), kind-of-system names lower (`__linux__`,
`__unix__`) --- and these name kinds of target, sitting beside the second
family in real guards. The prefix is load-bearing: a name mcpp owns means what
mcpp says it means, which is exactly what `__CYGWIN__` could not offer.
`__openkal__` joins the same contract; `__unix__` is listed as SUPPLIED rather
than owned, so it keeps the standard spelling and mcpp may not redefine it.
THE SEPARATION IS ITSELF A TESTED PROPERTY. The macro was first realised in
`mcpp.toolchain.cenv`, which made it derived from a declaration --- yet
whether a target is Windows does not depend on any `[c-abi]` block existing.
Moving it out turned the cenv test red, correctly; that test now asserts the
realisation does NOT carry it, because a token with two owners is a token that
will disagree with itself.
docs/21 renders the contract in both languages, and docs/24's note that the
`__CYGWIN__` trade-off "may flip" is updated: it has, and the replacement has
a name.
0 commit comments