diff --git a/CHANGES b/CHANGES index 6ca8a08e9..3166536fc 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,7 @@ Emulation fixes: Other fixes: - All: Improve export headers (fixes mgba.io/i/1738) - All: Correct format strings for some numbers on Windows (fixes mgba.io/i/1794) + - All: Correct more format strings on Windows (fixes mgba.io/i/1817) - Core: Ensure ELF regions can be written before trying - Debugger: Don't skip undefined instructions when debugger attached - FFmpeg: Fix some small memory leaks diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cabb0887..114f95360 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,10 @@ if(NOT MSVC) set(CMAKE_C_EXTENSIONS ON) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-missing-field-initializers") + if(WIN32) + # mingw32 likes to complain about using the "wrong" format strings despite them actually working + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format") + endif() else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /wd4003 /wd4244 /wd4146") endif() diff --git a/include/mgba-util/common.h b/include/mgba-util/common.h index 0f4a991bb..00193f6ff 100644 --- a/include/mgba-util/common.h +++ b/include/mgba-util/common.h @@ -14,6 +14,10 @@ #define CXX_GUARD_END #endif +#ifdef __MINGW32__ +#define __USE_MINGW_ANSI_STDIO 1 +#endif + CXX_GUARD_START #include