Skip to content

feat: define the version macros in ppack.h - #13

Merged
aajll merged 1 commit into
masterfrom
12-feat-version-macros-main-header
Oct 15, 2026
Merged

aajll merged 1 commit into
masterfrom
12-feat-version-macros-main-header

Conversation

@aajll

@aajll aajll commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • ppack.h defines PPACK_VERSION_MAJOR, _MINOR, _PATCH, PPACK_VERSION, PPACK_VERSION_STRING and a new PPACK_VERSION_NUMBER (long, MAJOR * 10000 + MINOR * 100 + PATCH), so a copy-in build carries its version.
  • meson.build reads the header with fs.read and fails to configure when any macro differs from project(version:); meson_version is now >=0.57.0. The generated template is removed.
  • ppack_version.h is a deprecated header that includes ppack.h, installed beside it until the next major release.
  • tests/test_edge.c includes ppack_version.h and checks PPACK_VERSION_NUMBER against its parts.
  • The version block carries an inline Rule 2.5 deviation (unused macro); docs/design.md already lists the public-macro 2.5 deviations. docs/api.md gains a Version section with a compiled #if example; integration, AGENTS and CHANGELOG are updated.

Checks run

  • meson test under ASan and UBSan: 3/3, including test_version_macros.
  • Drift check falsified: PPACK_VERSION_MINOR set to 6 fails configure with include/ppack.h must define PPACK_VERSION_MINOR as 5.
  • misch run and misch deviations: clean. scripts/format.sh: clean.
  • A probe including ppack_version.h and checking every macro compiles with gcc -Werror and with cl2000 22.6.2 and 25.11.1 --c11 under COFF and EABI with --emit_warnings_as_errors. The g++ leg is skipped because ppack_platform.h uses _Static_assert, which is outside this change.

Refs #12

ppack_version.h was generated at configure time, so a copied-in header had no version. ppack.h now defines the macros, including a long PPACK_VERSION_NUMBER that cannot overflow a 16-bit int, and meson setup fails when they differ from project(version:). ppack_version.h stays installed as a deprecated header that includes ppack.h.

The version block carries an inline Rule 2.5 deviation, because the library defines the macros for consumers and never uses them.

Refs #12
@aajll
aajll merged commit c19f973 into master Oct 15, 2026
9 checks passed
@aajll
aajll deleted the 12-feat-version-macros-main-header branch October 15, 2026 13:21
@aajll aajll mentioned this pull request Oct 15, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant