Fix MinGW builds

This commit is contained in:
Cacodemon345 2024-09-29 00:20:40 +06:00 committed by Christoph Oelckers
parent 50ad730c38
commit 7307ecfc93
3 changed files with 11 additions and 1 deletions

View file

@ -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)

View file

@ -39,6 +39,7 @@
#include <mmsystem.h>
#include <algorithm>
#include <mutex>
#include <stdexcept>
#include <assert.h>
// HEADER FILES ------------------------------------------------------------

View file

@ -4,6 +4,7 @@
#ifdef WIN32
#include <Windows.h>
#include <assert.h>
#include <stdio.h>
/* 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
#endif