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

Common: Add a strerror_r wrapper #12043

Merged
merged 2 commits into from Jul 16, 2023
Merged

Conversation

sepalani
Copy link
Contributor

This PR is an alternative approach to #12037 which tries to fix a compilation issue related to strerror_r.

@AnErrupTion
Does this approach fix your compilation issue on musl libc?

Ready to be reviewed & tested.

// There are two variants of strerror_r. The XSI version stores the message to the passed-in
// buffer and returns an int (0 on success). The GNU version returns a pointer to the message,
// which might have been stored in the passed-in buffer or might be a static string.

// We check defines in order to figure out variant is in use, and we store the returned value
// to a variable so that we'll get a compile-time check that our assumption was correct.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part about storing the value in a variable to get a type check is no longer true. (For the GNU case, that is.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I'll remove that part from the comment.

@AnErrupTion
Copy link

@sepalani It does fix the issue!

@AdmiralCurtiss
Copy link
Contributor

Seems fine.

@AdmiralCurtiss AdmiralCurtiss merged commit d867e2b into dolphin-emu:master Jul 16, 2023
11 checks passed
@sepalani sepalani deleted the strerror branch July 29, 2023 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants