Repository navigation
Conversation
Code selecting _POSIX_C_SOURCE=199309L can see clock_gettime, but cannot use CLOCK_REALTIME or TIMER_ABSTIME from time.h. Lower the constant visibility guards to match the API declarations and current FreeBSD compatibility behavior.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code that selects
_POSIX_C_SOURCE=199309Lcan seeclock_gettime()in this SDK's<time.h>, but cannot useCLOCK_REALTIME: the constants are hidden until200112.TIMER_ABSTIMEhas the same mismatch.This showed up while porting code using libretro-common's threading helpers. Lowering the two visibility guards to
199309lets those consumers compile without changing their feature-test macros. The numeric values and function declarations stay the same.Current FreeBSD uses the same visibility level for these constants. In particular, its broader clock visibility is a compatibility choice; this PR does not claim every clock in the block was introduced in POSIX.1b.
Validation
Cross-compiled with Clang 23.1.1 targeting
x86_64-sie-ps5. The following source fails against upstream and compiles with this change:From the repository root, save it as
/tmp/sdk-clock-visibility.cand run:clang -target x86_64-sie-ps5 -isystem include/freebsd \ -fsyntax-only /tmp/sdk-clock-visibility.cAlso checked
199506L(fixed),200112L,200809L, and the default feature level (still compile), and199209L(the constants remain hidden). This is a compile-time header fix; no console run was needed.