Skip to content

fix(sdk): correct the Apple to_chars guard macro spelling + release 0.16.2#146

Merged
facontidavide merged 1 commit into
mainfrom
fix/apple-macro-spelling
Jul 10, 2026
Merged

fix(sdk): correct the Apple to_chars guard macro spelling + release 0.16.2#146
facontidavide merged 1 commit into
mainfrom
fix/apple-macro-spelling

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

Summary

CCI round 3 failed at the same to_chars line — because 0.16.1's guard could never engage: it tested __ENVIRONMENT_MACOS_VERSION_MIN_REQUIRED__, a macro that does not exist. The compiler defines __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ (historic MAC_OS_X spelling — verified against clang's OSTargets.cpp, line 123). defined(...) of a misspelled macro is silently false on every platform, so all Apple builds still compiled the floating-point std::to_chars path.

Fix

  • Correct macro spelling.
  • Guard made fail-safe: any Apple target that is not provably macOS ≥ 13.3 — including non-macOS Apple platforms, which spell the macro differently — takes the snprintf fallback. Worst case is a slightly slower, non-minimal-digits (but exact) formatting where to_chars was actually available.

Verification (no Mac required)

The 0.16.1 bug slipped through because I tested a re-typed copy of the branch body, not the header's actual #if. This time the header's exact guard lines are extracted verbatim and run through the preprocessor across the matrix:

Scenario Branch taken
__APPLE__, target 13.0 (= CCI's MACOSX_DEPLOYMENT_TARGET) snprintf fallback ✅
__APPLE__, target 13.3 std::to_chars
__APPLE__, target 26.0 std::to_chars
__APPLE__, macro undefined (e.g. iOS) snprintf fallback
non-Apple std::to_chars

Plus ./build.sh --debug + ./test.sh — 49/49 pass.

Release 0.16.2 (PATCH)

Same drill: three version sources + docstring, [0.16.2] CHANGELOG entry, CCI staging recipe re-seeded at 0.16.2 with placeholder sha256.

After merge

Tag v0.16.2 → fill real sha256 → update CCI PR #30605 to plotjuggler_sdk/0.16.2.

🤖 Generated with Claude Code

….16.2

0.16.1's fallback guard checked __ENVIRONMENT_MACOS_VERSION_MIN_REQUIRED__,
which does not exist — clang defines
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ (verified against clang's
OSTargets.cpp) — so defined(...) was always false and every Apple build
still hit the unavailable FP std::to_chars (CCI round 3 failed at the
same line). The guard now uses the correct macro and is fail-safe: any
Apple target not provably macOS >= 13.3 takes the snprintf path.

Verified by preprocessing the header's exact #if line under deployment
targets 13.0/13.3/26.0/undefined/non-Apple — fallback engages exactly
when it should.

PATCH bump 0.16.1 -> 0.16.2; CCI staging recipe re-seeded at 0.16.2
(placeholder sha256 until the tag exists).

Build (debug+ASAN) + 49/49 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@facontidavide facontidavide merged commit bb50ac6 into main Jul 10, 2026
6 of 7 checks passed
@facontidavide facontidavide deleted the fix/apple-macro-spelling branch July 10, 2026 16:20
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