Skip to content

Commit

Permalink
Fix MinGW builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Sep 28, 2024
1 parent 50ad730 commit 7b06998
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions source/mididevices/music_win_mididevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <mmsystem.h>
#include <algorithm>
#include <mutex>
#include <stdexcept>
#include <assert.h>

// HEADER FILES ------------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion thirdparty/fluidsynth/src/utils/win32_glibstubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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)

Expand Down Expand Up @@ -134,4 +138,4 @@ typedef DWORD GStaticPrivate;

#endif

#endif
#endif

0 comments on commit 7b06998

Please sign in to comment.