Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allegrex v4.4.0 lock api & Fix CLOCKS_PER_SEC #11

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

fjtrujy
Copy link
Member

@fjtrujy fjtrujy commented Apr 20, 2024

This PR does 2 things:

Newlib by default defines CLOCKS_PER_SEC as 1000 which is wrong,. it should be 1000000.

Official info:

The clock() function conforms to ISO/IEC 9899:1990 (“ISO C90”) and Version 3 of the Single UNIX Specification (“SUSv3”) which requires CLOCKS_PER_SEC to be defined as one million.

To have thread-safe operations for all the newlib operations we have been required to do several PR:

This PR skips the usage of the dummy lock API, letting us implement the specific one in the pspsdk/libcglue

Cheers

@fjtrujy fjtrujy marked this pull request as ready for review April 20, 2024 22:15
@MotoLegacy
Copy link

I've left some feedback via instant messaging on the CLOCKS_PER_SEC change and it's compatibility issues which I will relay here:

thats a pretty significant breaking change
microsoft windows has had an incorrect clocks_per_second and they refuse to fix it because of compatibility
same goes for other platforms too like webGL, clocks_per_second being variable is just the norm
an unfortunate one, but the norm.
we should really version our sdk with macros so we can still support the old macro definition if we want to do that :/

i was using clocks_per_second in a game i was looking to port :p if i had gotten to it earlier i wouldve had to figure out the issue there which would make me very frustrated (as whats happened the last X amount of times things break)
https://github.com/MotoLegacy/SAVETHEM/blob/main/source/clockfix.h

@diamant3 diamant3 merged commit 579341c into allegrex-v4.4.0 Apr 25, 2024
1 of 2 checks passed
@sharkwouter sharkwouter deleted the allegrex-v4.4.0-lockAPI branch April 25, 2024 12:18
fjtrujy pushed a commit that referenced this pull request May 16, 2024
Fix usage of `wait`, `fork`, adding `execve` and variants
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.

3 participants