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

"#undef errno" breaks platforms with non-standard errno definitions #26

Open
asiekierka opened this issue May 7, 2024 · 2 comments
Open

Comments

@asiekierka
Copy link
Contributor

For example, picolibc is compiled by default with thread-local storage enabled; while thread-local storage is of dubious usefulness for most GBA developers (Wonderful currently enables it to avoid building a separate world of packages like libstdc++ for the GBA alone), it makes the library less portable.

@felixjones
Copy link
Owner

Is there an errno API that could be used? Only reason it is used is to maintain POSIX API compliance

@asiekierka
Copy link
Contributor Author

asiekierka commented Jun 18, 2024

Yes. It's in errno.h - including errno.h alone should do the trick. As per the C11 standard's final draft:

[...] errno, which expands to a modifiable lvalue that has type int and thread local storage duration, the value of which is set to a positive error number by several library functions.

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

No branches or pull requests

2 participants