mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-06 01:16:17 +01:00
glocalfileinfo: Fix GLocalFileStat getters on MinGW x86
For some reason, `time_t` is defined as being 32 bits wide on that platform, which causes truncation of the timestamps from `struct stat`. Avoid that problem by consistently using a 64-bit return value from the `struct stat` accessors. Helps: #3039
This commit is contained in:
parent
9845f880ca
commit
2dc0a43bc0
@ -316,13 +316,13 @@ inline static blkcnt_t _g_stat_blocks (const GLocalFileStat *buf) { return b
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef G_OS_WIN32
|
#ifndef G_OS_WIN32
|
||||||
inline static time_t _g_stat_atime (const GLocalFileStat *buf) { return buf->st_atime; }
|
inline static guint64 _g_stat_atime (const GLocalFileStat *buf) { return buf->st_atime; }
|
||||||
inline static time_t _g_stat_ctime (const GLocalFileStat *buf) { return buf->st_ctime; }
|
inline static guint64 _g_stat_ctime (const GLocalFileStat *buf) { return buf->st_ctime; }
|
||||||
inline static time_t _g_stat_mtime (const GLocalFileStat *buf) { return buf->st_mtime; }
|
inline static guint64 _g_stat_mtime (const GLocalFileStat *buf) { return buf->st_mtime; }
|
||||||
#else
|
#else
|
||||||
inline static time_t _g_stat_atime (const GLocalFileStat *buf) { return buf->st_atim.tv_sec; }
|
inline static guint64 _g_stat_atime (const GLocalFileStat *buf) { return buf->st_atim.tv_sec; }
|
||||||
inline static time_t _g_stat_ctime (const GLocalFileStat *buf) { return buf->st_ctim.tv_sec; }
|
inline static guint64 _g_stat_ctime (const GLocalFileStat *buf) { return buf->st_ctim.tv_sec; }
|
||||||
inline static time_t _g_stat_mtime (const GLocalFileStat *buf) { return buf->st_mtim.tv_sec; }
|
inline static guint64 _g_stat_mtime (const GLocalFileStat *buf) { return buf->st_mtim.tv_sec; }
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) || defined(G_OS_WIN32)
|
#if defined(HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) || defined(G_OS_WIN32)
|
||||||
inline static guint32 _g_stat_atim_nsec (const GLocalFileStat *buf) { return buf->st_atim.tv_nsec; }
|
inline static guint32 _g_stat_atim_nsec (const GLocalFileStat *buf) { return buf->st_atim.tv_nsec; }
|
||||||
|
Loading…
Reference in New Issue
Block a user