Skip to content

docs: pin the libmuslim header download and document the include-once rule - #28

Merged
rizukirr merged 3 commits into
mainfrom
libmuslim-v0.1.0-docs
Aug 18, 2026
Merged

docs: pin the libmuslim header download and document the include-once rule#28
rizukirr merged 3 commits into
mainfrom
libmuslim-v0.1.0-docs

Conversation

@rizukirr

@rizukirr rizukirr commented Aug 18, 2026

Copy link
Copy Markdown
Member

Two fixes to the C overview, following the v0.1.0 release.

The download now pins a tag

The install instructions told readers to curl the headers from main. main moves, and a vendored header changing underneath a project is exactly the failure the single-header convention exists to avoid.

It now pins v0.1.0 and links the releases page so the next tag is one click away.

Include-once caveat

The implementation block sits outside the include guard, as it does in stb and miniaudio. So a file that defines PRAYERTIMES_IMPLEMENTATION and then includes another header that reaches prayertimes.h gets:

error: redefinition of 'calculate_prayer_times'

The header already says to define the macro in exactly one source file, which reads as sufficient but is not. It cost a real build break downstream in muslimtify, where display.c defined the macro and then included three headers that each reached prayertimes.h.

The documented fix is a dedicated translation unit that includes nothing else, which is what muslimtify now does and what its vendored miniaudio.c already did.

Verification

npm run build succeeds.

The C section documented every type and function but never said what the
numbers are worth. Prayer times are an act of worship, so a page that
states what has been measured and what has not belongs next to the API.

accuracy.md records the measured maghrib bound of 6.5966 s against a JPL
DE440 validated solver, and is equally explicit that the bound covers
|latitude| <= 60 only, that sunrise, fajr, isha and asr have no oracle,
and that dhuha returns NaN above roughly 62.5 degrees with no error and
no sentinel.

That NaN is a raw C hazard only. The Rust binding returns
Error::NonFiniteResult and the Dart binding throws
PrayerTimesUnavailable, so the page says so rather than implying every
caller has to write the check.

The overview told readers to curl the headers from main. main moves, and
a vendored header changing underneath a project is the failure the
single-header convention exists to avoid, so it now pins v0.1.0 and
points at the releases page.

It also gains the include-once caveat. The implementation block sits
outside the include guard, so a file that defines the macro and then
includes another header reaching prayertimes.h gets a redefinition
error. This cost a real build break downstream, and a dedicated
translation unit is the fix.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
muslimtify Ready Ready Preview Aug 18, 2026 11:48am

Not wanted. The two overview fixes stand on their own.
@rizukirr rizukirr changed the title docs: add an accuracy page for libmuslim C and pin the header download docs: pin the libmuslim header download and document the include-once rule Aug 18, 2026
@rizukirr
rizukirr merged commit 60f7e68 into main Aug 18, 2026
3 checks passed
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