docs: harden ABI header — explicit SW_CALL + fixed enum width
Round-2 review: Codex / Claude / Kimi re-passed LGTM at 99a00bc; Copilot raised three ABI-stability points on the header, all addressed here. - **Explicit calling convention.** Relying on the compiler default is fragile — MSVC `/Gz` flips the default to `__stdcall`. Add a `SW_CALL` macro (`__cdecl` on Windows, empty elsewhere) and annotate every exported function with it, so the ABI is pinned regardless of build flags. - **Fixed enum width.** C enum size is implementation-defined, so `sw_error_t` / `sw_reading_type_t` could change width under e.g. `-fshort-enums` and break bindings that treat them as 32-bit. Add a portable `SW_STATIC_ASSERT` (`_Static_assert` / C++ `static_assert`, no-op before C11/C++11) and assert `sizeof(...) == 4` for both. Verified the assertion actually fires under `gcc -fshort-enums`. Docs updated to match: `C_ABI.md` "Naming, Linkage, and Versioning" documents the `SW_CALL` pin and the enum-width assertions; `C_CODING_STANDARDS.md` §6 now tells implementers to pin `__cdecl` via an explicit macro rather than trust the default. Header compiles clean from C (clang/gcc `-std=c17`) and C++ (g++ `-std=c++17`) under `-Wall -Wextra -Werror -Wconversion -Wshadow -Wpedantic`, degrades gracefully under `-std=c99` (asserts become no-ops); `uv run pytest` -> 42 passed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
C
Claude Coder committed
5d19e3dc89f5b9b9c9d079e74960f30fa50eb946
Parent: 99a00bc