mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-02-22 11:51:56 +00:00
Use glib's g_stat to get file modification time
This commit is contained in:
parent
7e36bcf058
commit
f8bc376392
2 changed files with 8 additions and 7 deletions
|
@ -267,18 +267,13 @@ static fluid_samplecache_entry_t *get_samplecache_entry(SFData *sf,
|
|||
|
||||
static int fluid_get_file_modification_time(char *filename, time_t *modification_time)
|
||||
{
|
||||
#if defined(WIN32) || defined(__OS2__)
|
||||
*modification_time = 0;
|
||||
return FLUID_OK;
|
||||
#else
|
||||
struct stat buf;
|
||||
fluid_stat_buf_t buf;
|
||||
|
||||
if (stat(filename, &buf) == -1)
|
||||
if (fluid_stat(filename, &buf))
|
||||
{
|
||||
return FLUID_FAILED;
|
||||
}
|
||||
|
||||
*modification_time = buf.st_mtime;
|
||||
return FLUID_OK;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
#include <gmodule.h>
|
||||
#endif
|
||||
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
/**
|
||||
* Macro used for safely accessing a message from a GError and using a default
|
||||
* message if it is NULL.
|
||||
|
@ -355,6 +357,10 @@ void fluid_socket_close(fluid_socket_t sock);
|
|||
fluid_istream_t fluid_socket_get_istream(fluid_socket_t sock);
|
||||
fluid_ostream_t fluid_socket_get_ostream(fluid_socket_t sock);
|
||||
|
||||
/* File access */
|
||||
typedef GStatBuf fluid_stat_buf_t;
|
||||
#define fluid_stat(_filename, _statbuf) g_stat((_filename), (_statbuf))
|
||||
|
||||
|
||||
/* Profiling */
|
||||
#if WITH_PROFILING
|
||||
|
|
Loading…
Reference in a new issue