From 6309a9c6a755a59be5d243971bcbd4539e4dd12a Mon Sep 17 00:00:00 2001 From: rogerman Date: Fri, 7 Jun 2024 17:16:53 -0700 Subject: [PATCH] libretro: So apparently, _XOPEN_SOURCE has to be at the top of the file. Hopefully this makes both GCC14 users and Mac users happy. (Related to commit 779606e. Based on PR #793.) --- desmume/src/libretro-common/file/file_path.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desmume/src/libretro-common/file/file_path.c b/desmume/src/libretro-common/file/file_path.c index 8836538b7..21e7f1e51 100644 --- a/desmume/src/libretro-common/file/file_path.c +++ b/desmume/src/libretro-common/file/file_path.c @@ -20,6 +20,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifdef __MACH__ +#define _DARWIN_C_SOURCE /* As below, plus strl* functions */ +#else +#define _XOPEN_SOURCE 500 /* For strdup, realpath */ +#endif + #include #include #include @@ -31,7 +37,6 @@ #include #ifndef __MACH__ -#define _XOPEN_SOURCE 500 /* For strdup, realpath */ #include #include #endif