Skip to content

feat: define the version macros in fpc_status.h - #16

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

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

Conversation

@aajll

@aajll aajll commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • fpc_status.h defines FPC_VERSION and a new FPC_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.
  • fpc_version.h is a deprecated header that includes fpc_status.h, installed beside it until the next major release.
  • The library has no single main header, so the macros go in fpc_status.h, which fpc_pid.h and fpc_filters.h both include. fpc_version.h is installed as a deprecated header that includes it.
  • inc drops the '.' directory, which only served the generated header.
  • tests/test_filters.c gains a version_macros case that includes fpc_version.h and checks FPC_VERSION_NUMBER against its parts.
  • The version block carries an inline Rule 2.5 deviation (unused macro), recorded in docs/design.md; the baseline is unchanged. 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: unit tests (27 subtests, including version_macros) and the docs examples pass.
  • Drift check falsified: FPC_VERSION_MINOR set to 4 fails configure with include/fpc_status.h must define FPC_VERSION_MINOR as 3.
  • misch run --baseline and misch deviations: clean. scripts/format.sh: clean.
  • A probe including only fpc_version.h and checking every macro compiles with gcc and g++ -Werror and with cl2000 22.6.2 and 25.11.1 --c11 under COFF and EABI with --emit_warnings_as_errors.

Refs #15

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

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

Refs #15
@aajll
aajll merged commit 36dc650 into master Oct 15, 2026
10 checks passed
@aajll
aajll deleted the 15-feat-version-macros-main-header branch October 15, 2026 13:33
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