mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-03-02 07:21:58 +00:00
parent
12dd1c7653
commit
b6a5c5f570
2 changed files with 12 additions and 8 deletions
|
@ -457,6 +457,10 @@ else(NOT enable-pkgconfig)
|
||||||
# Mandatory libraries: glib and gthread
|
# Mandatory libraries: glib and gthread
|
||||||
pkg_check_modules ( GLIB REQUIRED glib-2.0>=2.6.5 gthread-2.0>=2.6.5 )
|
pkg_check_modules ( GLIB REQUIRED glib-2.0>=2.6.5 gthread-2.0>=2.6.5 )
|
||||||
|
|
||||||
|
if ( GLIB_VERSION VERSION_LESS "2.26" )
|
||||||
|
message ( WARNING "Your version of glib is very old. This may cause problems with fluidsynth's sample cache on Windows. Consider updating to glib 2.26 or newer!" )
|
||||||
|
endif ( GLIB_VERSION VERSION_LESS "2.26" )
|
||||||
|
|
||||||
include ( UnsetPkgConfig )
|
include ( UnsetPkgConfig )
|
||||||
|
|
||||||
# Optional features
|
# Optional features
|
||||||
|
|
|
@ -374,16 +374,17 @@ fluid_istream_t fluid_socket_get_istream(fluid_socket_t sock);
|
||||||
fluid_ostream_t fluid_socket_get_ostream(fluid_socket_t sock);
|
fluid_ostream_t fluid_socket_get_ostream(fluid_socket_t sock);
|
||||||
|
|
||||||
/* File access */
|
/* File access */
|
||||||
|
#define fluid_stat(_filename, _statbuf) g_stat((_filename), (_statbuf))
|
||||||
#if !GLIB_CHECK_VERSION(2, 26, 0)
|
#if !GLIB_CHECK_VERSION(2, 26, 0)
|
||||||
/* GStatBuf has not been introduced yet, manually typedef to what they had at that time:
|
/* GStatBuf has not been introduced yet, manually typedef to what they had at that time:
|
||||||
* https://github.com/GNOME/glib/blob/e7763678b56e3be073cc55d707a6e92fc2055ee0/glib/gstdio.h#L98-L115
|
* https://github.com/GNOME/glib/blob/e7763678b56e3be073cc55d707a6e92fc2055ee0/glib/gstdio.h#L98-L115
|
||||||
*/
|
*/
|
||||||
#if defined(WIN32) || HAVE_WINDOWS_H // somehow reliably mock G_OS_WIN32??
|
#if defined(WIN32) || HAVE_WINDOWS_H // somehow reliably mock G_OS_WIN32??
|
||||||
#if defined (_MSC_VER) && !defined(_WIN64)
|
// Any effort from our side to reliably mock GStatBuf on Windows is in vain. E.g. glib-2.16 is broken as it uses struct stat rather than struct _stat32 on Win x86.
|
||||||
typedef struct _stat32 fluid_stat_buf_t;
|
// Disable it (the user has been warned by cmake).
|
||||||
#else
|
#undef fluid_stat
|
||||||
typedef struct _stat fluid_stat_buf_t;
|
#define fluid_stat(_filename, _statbuf) (-1)
|
||||||
#endif
|
typedef struct _fluid_stat_buf_t{int st_mtime;} fluid_stat_buf_t;
|
||||||
#else
|
#else
|
||||||
/* posix, OS/2, etc. */
|
/* posix, OS/2, etc. */
|
||||||
typedef struct stat fluid_stat_buf_t;
|
typedef struct stat fluid_stat_buf_t;
|
||||||
|
@ -391,7 +392,6 @@ fluid_ostream_t fluid_socket_get_ostream(fluid_socket_t sock);
|
||||||
#else
|
#else
|
||||||
typedef GStatBuf fluid_stat_buf_t;
|
typedef GStatBuf fluid_stat_buf_t;
|
||||||
#endif
|
#endif
|
||||||
#define fluid_stat(_filename, _statbuf) g_stat((_filename), (_statbuf))
|
|
||||||
|
|
||||||
#define fluid_file_test g_file_test
|
#define fluid_file_test g_file_test
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue