From 2e92fc601e3fe864617064bd081d7f23c298669d Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 5 Aug 2005 10:49:56 +0000 Subject: MinGW fix. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@472 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 7 +++++++ ChangeLog.ja | 7 +++++++ configure.in | 1 + src/mbox.c | 4 ++++ src/mh.c | 4 ++++ src/session.c | 2 ++ 6 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 07ebb3f4..fadd2f9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-05 + + * src/mh.c + src/session.c + src/mbox.c: braced Unix-specific code with #ifdef G_OS_UNIX. + * configure.in: added -lws2_32 on MinGW environment. + 2005-08-05 * src/filter.c diff --git a/ChangeLog.ja b/ChangeLog.ja index 0cd124e1..59990c7e 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,10 @@ +2005-08-05 + + * src/mh.c + src/session.c + src/mbox.c: Unix 特有のコードを #ifdef G_OS_UNIX で括った。 + * configure.in: MinGW 環境で -lws2_32 を付加。 + 2005-08-05 * src/filter.c diff --git a/configure.in b/configure.in index d5febe3f..800ce565 100644 --- a/configure.in +++ b/configure.in @@ -59,6 +59,7 @@ case "$target" in ;; *-*-mingw*) CFLAGS="$CFLAGS -mms-bitfields" + LIBS="$LIBS -lws2_32" ;; esac diff --git a/src/mbox.c b/src/mbox.c index 05efa69f..6742069a 100644 --- a/src/mbox.c +++ b/src/mbox.c @@ -257,6 +257,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, GHashTable *folder_table) gint lock_mbox(const gchar *base, LockType type) { +#ifdef G_OS_UNIX gint retval = 0; if (type == LOCK_FILE) { @@ -327,6 +328,9 @@ gint lock_mbox(const gchar *base, LockType type) } return retval; +#else + return -1; +#endif /* G_OS_UNIX */ } gint unlock_mbox(const gchar *base, gint fd, LockType type) diff --git a/src/mh.c b/src/mh.c index b539050d..3bdb17dd 100644 --- a/src/mh.c +++ b/src/mh.c @@ -405,14 +405,18 @@ static gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list, if (first_ == 0 || first_ > dest->last_num + 1) first_ = dest->last_num + 1; +#ifdef G_OS_UNIX if (link(fileinfo->file, destfile) < 0) { +#endif if (copy_file(fileinfo->file, destfile, TRUE) < 0) { g_warning(_("can't copy message %s to %s\n"), fileinfo->file, destfile); g_free(destfile); return -1; } +#ifdef G_OS_UNIX } +#endif g_free(destfile); dest->last_num++; diff --git a/src/session.c b/src/session.c index 0aecb335..6e7fa4e9 100644 --- a/src/session.c +++ b/src/session.c @@ -275,11 +275,13 @@ static gint session_close(Session *session) { g_return_val_if_fail(session != NULL, -1); +#ifdef G_OS_UNIX if (session->conn_id > 0) { sock_connect_async_cancel(session->conn_id); session->conn_id = 0; debug_print("session (%p): connection cancelled\n", session); } +#endif session_set_timeout(session, 0); -- cgit v1.2.3