Skip to content

feat: define the version macros in seqlock.h - #9

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

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

Conversation

@aajll

@aajll aajll commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • seqlock.h defines SEQLOCK_VERSION_MAJOR, _MINOR, _PATCH, SEQLOCK_VERSION, SEQLOCK_VERSION_STRING and a new SEQLOCK_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.
  • seqlock_version.h is a deprecated header that includes seqlock.h, installed beside it until the next major release.
  • tests/test_seqlock.c includes seqlock_version.h and checks SEQLOCK_VERSION_NUMBER against its parts.
  • The version block carries an inline Rule 2.5 deviation (unused macro), recorded in docs/design.md; the three baselines are 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: 11/11, including version_macros.
  • Drift check falsified: SEQLOCK_VERSION_PATCH set to 2 fails configure with include/seqlock.h must define SEQLOCK_VERSION_PATCH as 1.
  • misch run --baseline for the default, c11 and no_atomics profiles, and misch deviations: clean. scripts/format.sh: clean.
  • A probe including seqlock_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.

Refs #8

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

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

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