diff --git a/CMakeLists.txt b/CMakeLists.txt index 6680e9b..5dd8354 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,6 +128,11 @@ endif() # Initialize our list of find_package dependencies for configure_package_config_file set(ZMUSIC_PACKAGE_DEPENDENCIES "" CACHE INTERNAL "") +if (WIN32 AND MINGW) + add_compile_definitions(-D_UNICODE -DUNICODE) + add_compile_definitions(-D__USE_MINGW_ANSI_STDIO=1) +endif() + add_subdirectory(thirdparty) add_subdirectory(source) diff --git a/source/mididevices/music_win_mididevice.cpp b/source/mididevices/music_win_mididevice.cpp index 19915a5..e4d1d51 100644 --- a/source/mididevices/music_win_mididevice.cpp +++ b/source/mididevices/music_win_mididevice.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include // HEADER FILES ------------------------------------------------------------ diff --git a/thirdparty/fluidsynth/src/utils/win32_glibstubs.h b/thirdparty/fluidsynth/src/utils/win32_glibstubs.h index 0e768e9..92380d8 100644 --- a/thirdparty/fluidsynth/src/utils/win32_glibstubs.h +++ b/thirdparty/fluidsynth/src/utils/win32_glibstubs.h @@ -4,6 +4,7 @@ #ifdef WIN32 #include #include +#include /* Miscellaneous stubs */ #define GLIB_CHECK_VERSION(x, y, z) 0 /* Evaluate to 0 to get FluidSynth to use the "old" thread API */ @@ -26,6 +27,9 @@ typedef void *gpointer; #define G_UNLIKELY(expr) (expr) #endif +#define g_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a) +#define g_snprintf(b, c, f, ...) snprintf(b, c, f, __VA_ARGS__) + #define g_return_val_if_fail(expr, val) if (expr) {} else { return val; } #define g_clear_error(err) do {} while (0) @@ -134,4 +138,4 @@ typedef DWORD GStaticPrivate; #endif -#endif \ No newline at end of file +#endif