aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/mh.c6
-rw-r--r--libsylph/procheader.c2
-rw-r--r--libsylph/socket.c2
-rw-r--r--libsylph/utils.c8
-rw-r--r--libsylph/utils.h8
5 files changed, 17 insertions, 9 deletions
diff --git a/libsylph/mh.c b/libsylph/mh.c
index e30c0078..c1f06797 100644
--- a/libsylph/mh.c
+++ b/libsylph/mh.c
@@ -937,7 +937,7 @@ static gint mh_remove_all_msg(Folder *folder, FolderItem *item)
static gboolean mh_is_msg_changed(Folder *folder, FolderItem *item,
MsgInfo *msginfo)
{
- struct stat s;
+ GStatBuf s;
gchar buf[16];
if (g_stat(utos_buf(buf, msginfo->msgnum), &s) < 0 ||
@@ -1460,7 +1460,7 @@ static gint mh_remove_folder(Folder *folder, FolderItem *item)
static time_t mh_get_mtime(FolderItem *item)
{
gchar *path;
- struct stat s;
+ GStatBuf s;
path = folder_item_get_path(item);
if (g_stat(path, &s) < 0) {
@@ -1676,7 +1676,7 @@ static void mh_scan_tree_recursive(FolderItem *item)
#else
DIR *dp;
struct dirent *d;
- struct stat s;
+ GStatBuf s;
#endif
const gchar *dir_name;
gchar *fs_path;
diff --git a/libsylph/procheader.c b/libsylph/procheader.c
index 96cca15c..6c942e70 100644
--- a/libsylph/procheader.c
+++ b/libsylph/procheader.c
@@ -519,7 +519,7 @@ void procheader_get_header_fields(FILE *fp, HeaderEntry hentry[])
MsgInfo *procheader_parse_file(const gchar *file, MsgFlags flags,
gboolean full)
{
- struct stat s;
+ GStatBuf s;
FILE *fp;
MsgInfo *msginfo;
diff --git a/libsylph/socket.c b/libsylph/socket.c
index 6da0b6f8..18ffbe48 100644
--- a/libsylph/socket.c
+++ b/libsylph/socket.c
@@ -792,7 +792,7 @@ static void resolver_init(void)
{
#ifdef G_OS_UNIX
static time_t resolv_conf_mtime = 0;
- struct stat s;
+ GStatBuf s;
if (g_stat("/etc/resolv.conf", &s) == 0 &&
s.st_mtime != resolv_conf_mtime) {
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 2b4f9f3c..015406d5 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -2397,7 +2397,7 @@ const gchar *get_domain_name(void)
off_t get_file_size(const gchar *file)
{
- struct stat s;
+ GStatBuf s;
if (g_stat(file, &s) < 0) {
FILE_OP_ERROR(file, "stat");
@@ -2509,7 +2509,7 @@ gboolean file_exist(const gchar *file, gboolean allow_fifo)
return FALSE;
if (allow_fifo) {
- struct stat s;
+ GStatBuf s;
if (g_stat(file, &s) < 0) {
if (ENOENT != errno) FILE_OP_ERROR(file, "stat");
@@ -2717,7 +2717,7 @@ gint remove_expired_files(const gchar *dir, guint hours)
{
GDir *dp;
const gchar *dir_name;
- struct stat s;
+ GStatBuf s;
gchar *prev_dir;
guint file_no;
time_t mtime, now, expire_time;
@@ -2771,7 +2771,7 @@ gint remove_expired_files(const gchar *dir, guint hours)
static gint remove_dir_recursive_real(const gchar *dir)
{
- struct stat s;
+ GStatBuf s;
GDir *dp;
const gchar *dir_name;
gchar *prev_dir;
diff --git a/libsylph/utils.h b/libsylph/utils.h
index f93f4ce8..8fedd9d0 100644
--- a/libsylph/utils.h
+++ b/libsylph/utils.h
@@ -103,6 +103,14 @@ gint syl_link (const gchar *src,
typedef time_t stime_t;
#endif
+#if !GLIB_CHECK_VERSION(2, 26, 0)
+#if (defined (_MSC_VER) || defined (__MINGW32__)) && !defined(_WIN64)
+ typedef struct _stat32 GStatBuf;
+#else
+ typedef struct stat GStatBuf;
+#endif
+#endif
+
#ifndef BIG_ENDIAN_HOST
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
#define BIG_ENDIAN_HOST 1