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

libretro-common: fix implicit declarations #792

Merged
merged 1 commit into from
May 13, 2024

Conversation

atsampson
Copy link
Contributor

strdup and realpath are only declared by glibc's headers if _XOPEN_SOURCE >= 500.

(I checked libretro-common upstream, and this doesn't seem to have been fixed there; maybe they're not building with -std=c99 or similar. Previously it would just have produced a warning but an implicit declaration is a hard error with GCC 14.)

strdup and realpath are only declared by glibc's headers if
_XOPEN_SOURCE >= 500.
@zeromus zeromus merged commit 90d0abd into TASEmulators:master May 13, 2024
7 of 9 checks passed
@zeromus
Copy link
Contributor

zeromus commented May 13, 2024

that broke the mac build. strlcpy this time. increase the version number or something.

@rofl0r
Copy link
Collaborator

rofl0r commented May 13, 2024

usually 700 is the lowest value one uses for the XOPEN feature test macro.
strlcpy is a BSD-originated thing, so i guess additional defining _BSD_SOURCE could fix it.

@atsampson
Copy link
Contributor Author

atsampson commented May 13, 2024

Looking at macOS's cdefs.h and string.h, it looks like strlcpy is only declared if __DARWIN_C_LEVEL >= 900000, so there's no value of _XOPEN_SOURCE that would enable it. It might need an #ifdef for macOS to define _DARWIN_C_SOURCE there (or just not define _XOPEN_SOURCE there, if the default level was working already).

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