From 2bfc3e0ca623e4140e0f44ea75ab04512e41681a Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 1 Oct 2018 11:15:20 -0700 Subject: [PATCH] Wii: Define _GNU_SOURCE --- CHANGES | 2 +- CMakeLists.txt | 2 +- src/util/formatting.c | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 75cbe1fe9..5aa4681af 100644 --- a/CHANGES +++ b/CHANGES @@ -117,7 +117,7 @@ Bugfixes: Misc: - mGUI: Add SGB border configuration option - mGUI: Add support for different settings types - - Wii: Disable use of strtof_l (fixes mgba.io/i/1106) + - Wii: Define _GNU_SOURCE (fixes mgba.io/i/1106) - Wii: Expose stretch configuration in settings - Wii: Stretch now sets pixel-accurate mode size cap diff --git a/CMakeLists.txt b/CMakeLists.txt index 87deecf63..2281a45c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,7 +321,7 @@ if(WII) add_definitions(-U__STRICT_ANSI__) endif() -if(DEFINED 3DS) +if(3DS OR WII) add_definitions(-D_GNU_SOURCE) endif() diff --git a/src/util/formatting.c b/src/util/formatting.c index c6aa1e7b8..1305edfc9 100644 --- a/src/util/formatting.c +++ b/src/util/formatting.c @@ -59,11 +59,6 @@ int ftostr_u(char* restrict str, size_t size, float f) { } float strtof_u(const char* restrict str, char** restrict end) { -#ifdef GEKKO - // strtof_l appears to have broken in devkitPPC sometime around r28 - // TODO: Investigate further - float res = strtof(str, end); -#else #if HAVE_LOCALE locale_t l = newlocale(LC_NUMERIC_MASK, "C", 0); #else @@ -72,7 +67,6 @@ float strtof_u(const char* restrict str, char** restrict end) { float res = strtof_l(str, end, l); #if HAVE_LOCALE freelocale(l); -#endif #endif return res; }