aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-04-18 06:26:43 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-04-18 06:26:43 +0000
commit26b2f9567dc0bd7b70e6cc66eee800a1e0d89b73 (patch)
tree3eb93151b98eabb35e7c52b7ea6e6a79648227bd
parentd6433225cb188bace23a80686df3be09edaa6036 (diff)
wrapped time_t as stime_t. stime_t will be 32-bit on win32 for backward compatibility.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3386 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog16
-rwxr-xr-xautogen.sh7
-rw-r--r--configure.in16
-rw-r--r--libsylph/folder.c6
-rw-r--r--libsylph/folder.h7
-rw-r--r--libsylph/pop.h5
-rw-r--r--libsylph/procheader.c7
-rw-r--r--libsylph/procheader.h4
-rw-r--r--libsylph/procmsg.h5
-rw-r--r--libsylph/session.h3
-rw-r--r--libsylph/utils.c18
-rw-r--r--libsylph/utils.h16
-rw-r--r--src/addrcache.h3
-rw-r--r--src/jpilot.h3
14 files changed, 81 insertions, 35 deletions
diff --git a/ChangeLog b/ChangeLog
index 7dca5ed6..245b1be8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2014-04-18
+
+ * libsylph/utils.[ch]
+ libsylph/procheader.c
+ libsylph/procmsg.h
+ libsylph/procheader.h
+ libsylph/folder.[ch]
+ libsylph/pop.h
+ libsylph/session.h
+ src/addrcache.h
+ src/jpilot.h
+ configure.in: wrapped time_t as stime_t. stime_t will be 32-bit
+ on win32 for backward compatibility.
+ * configure.in: enable silent rules by default.
+ * autogen.sh: use newer aclocal and automake.
+
2014-04-11
* libsylph/folder.c:
diff --git a/autogen.sh b/autogen.sh
index 8f52ed75..7f987c9d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,8 +1,11 @@
#!/bin/sh
-aclocal -I ac \
+ACLOCAL=aclocal-1.11
+AUTOMAKE=automake-1.11
+
+$ACLOCAL -I ac \
&& libtoolize --force --copy \
&& autoheader \
- && automake --add-missing --foreign --copy \
+ && $AUTOMAKE --add-missing --foreign --copy \
&& autoconf \
&& ./configure $@
diff --git a/configure.in b/configure.in
index 191552e6..1b233e9b 100644
--- a/configure.in
+++ b/configure.in
@@ -6,11 +6,11 @@ PACKAGE=sylpheed
dnl version number
MAJOR_VERSION=3
MINOR_VERSION=4
-MICRO_VERSION=1
-INTERFACE_AGE=1
-BINARY_AGE=1
+MICRO_VERSION=2
+INTERFACE_AGE=2
+BINARY_AGE=2
EXTRA_VERSION=
-BUILD_REVISION=1157
+BUILD_REVISION=1158
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl define if this is a development release
@@ -21,7 +21,7 @@ AC_CANONICAL_SYSTEM
dnl
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
@@ -462,6 +462,12 @@ GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
AC_CHECK_SIZEOF(unsigned short, 2)
AC_CHECK_SIZEOF(unsigned int, 4)
AC_CHECK_SIZEOF(unsigned long, 4)
+AC_CHECK_SIZEOF(time_t)
+AC_CHECK_SIZEOF(off_t)
+
+if test "x$ac_cv_sizeof_time_t" = "x8"; then
+ AC_DEFINE(HAVE_64BIT_TIME_T, 1, Define if time_t is 64-bit)
+fi
dnl Checks for library functions.
AC_FUNC_ALLOCA
diff --git a/libsylph/folder.c b/libsylph/folder.c
index 0299fc5e..f188dba5 100644
--- a/libsylph/folder.c
+++ b/libsylph/folder.c
@@ -1634,7 +1634,7 @@ static gboolean folder_build_tree(GNode *node, gpointer data)
#endif
path = attr->value;
} else if (!strcmp(attr->name, "mtime"))
- mtime = strtoull(attr->value, NULL, 10);
+ mtime = strtoll(attr->value, NULL, 10);
else if (!strcmp(attr->name, "new"))
new = atoi(attr->value);
else if (!strcmp(attr->name, "unread"))
@@ -1945,8 +1945,8 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
}
fprintf(fp,
- " mtime=\"%llu\" new=\"%d\" unread=\"%d\" total=\"%d\"",
- (guint64)item->mtime, item->new, item->unread, item->total);
+ " mtime=\"%lld\" new=\"%d\" unread=\"%d\" total=\"%d\"",
+ (gint64)item->mtime, item->new, item->unread, item->total);
if (item->account)
fprintf(fp, " account_id=\"%d\"",
diff --git a/libsylph/folder.h b/libsylph/folder.h
index 5a9e9669..ef9eda28 100644
--- a/libsylph/folder.h
+++ b/libsylph/folder.h
@@ -20,6 +20,10 @@
#ifndef __FOLDER_H__
#define __FOLDER_H__
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <glib.h>
#include <time.h>
@@ -127,6 +131,7 @@ typedef void (*FolderDestroyNotify) (Folder *folder,
#include "prefs_account.h"
#include "session.h"
#include "procmsg.h"
+#include "utils.h"
struct _Folder
{
@@ -272,7 +277,7 @@ struct _FolderItem
gchar *name; /* UTF-8 */
gchar *path; /* UTF-8 */
- time_t mtime;
+ stime_t mtime;
gint new;
gint unread;
diff --git a/libsylph/pop.h b/libsylph/pop.h
index c3e67e89..050caf52 100644
--- a/libsylph/pop.h
+++ b/libsylph/pop.h
@@ -29,6 +29,7 @@
#include "session.h"
#include "prefs_account.h"
+#include "utils.h"
typedef struct _Pop3MsgInfo Pop3MsgInfo;
typedef struct _Pop3Session Pop3Session;
@@ -99,7 +100,7 @@ struct _Pop3MsgInfo
{
gint size;
gchar *uidl;
- time_t recv_time;
+ stime_t recv_time;
guint received : 1;
guint deleted : 1;
};
@@ -132,7 +133,7 @@ struct _Pop3Session
gboolean new_msg_exist;
gboolean uidl_is_valid;
- time_t current_time;
+ stime_t current_time;
Pop3ErrorValue error_val;
gchar *error_msg;
diff --git a/libsylph/procheader.c b/libsylph/procheader.c
index 93ef99e7..96cca15c 100644
--- a/libsylph/procheader.c
+++ b/libsylph/procheader.c
@@ -873,7 +873,7 @@ static gint procheader_scan_date_string(const gchar *str,
return -1;
}
-time_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
+stime_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
{
static gchar monthstr[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
gchar weekday[11];
@@ -951,14 +951,15 @@ time_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
return timer;
}
-void procheader_date_get_localtime(gchar *dest, gint len, const time_t timer)
+void procheader_date_get_localtime(gchar *dest, gint len, const stime_t timer)
{
+ time_t timer_ = timer;
struct tm *lt;
gchar *default_format = "%y/%m/%d(%a) %H:%M";
gchar *buf;
gchar tmp[BUFFSIZE];
- lt = localtime(&timer);
+ lt = localtime(&timer_);
if (!lt) {
g_warning("can't get localtime of %ld\n", timer);
dest[0] = '\0';
diff --git a/libsylph/procheader.h b/libsylph/procheader.h
index 0260b45e..fa8095a6 100644
--- a/libsylph/procheader.h
+++ b/libsylph/procheader.h
@@ -91,11 +91,11 @@ MsgInfo *procheader_parse_stream (FILE *fp,
gchar *procheader_get_fromname (const gchar *str);
gchar *procheader_get_toname (const gchar *str);
-time_t procheader_date_parse (gchar *dest,
+stime_t procheader_date_parse (gchar *dest,
const gchar *src,
gint len);
void procheader_date_get_localtime (gchar *dest,
gint len,
- const time_t timer);
+ const stime_t timer);
#endif /* __PROCHEADER_H__ */
diff --git a/libsylph/procmsg.h b/libsylph/procmsg.h
index a309bc8d..77f0d8ad 100644
--- a/libsylph/procmsg.h
+++ b/libsylph/procmsg.h
@@ -37,6 +37,7 @@ typedef struct _MsgEncryptInfo MsgEncryptInfo;
#include "folder.h"
#include "procmime.h"
+#include "utils.h"
typedef enum
{
@@ -172,8 +173,8 @@ struct _MsgInfo
{
guint msgnum;
gsize size;
- time_t mtime;
- time_t date_t;
+ stime_t mtime;
+ stime_t date_t;
MsgFlags flags;
diff --git a/libsylph/session.h b/libsylph/session.h
index 5fb25851..41c10e24 100644
--- a/libsylph/session.h
+++ b/libsylph/session.h
@@ -31,6 +31,7 @@
#include "socket.h"
#include "socks.h"
+#include "utils.h"
#define SESSION_BUFFSIZE 8192
@@ -116,7 +117,7 @@ struct _Session
SessionState state;
- time_t last_access_time;
+ stime_t last_access_time;
GTimeVal tv_prev;
gint conn_id;
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 1e54ebc5..2b4f9f3c 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -4315,7 +4315,7 @@ gint play_sound(const gchar *file, gboolean async)
return 0;
}
-time_t remote_tzoffset_sec(const gchar *zone)
+stime_t remote_tzoffset_sec(const gchar *zone)
{
static gchar ustzstr[] = "PSTPDTMSTMDTCSTCDTESTEDT";
gchar zone3[4];
@@ -4383,15 +4383,16 @@ time_t remote_tzoffset_sec(const gchar *zone)
return remoteoffset;
}
-time_t tzoffset_sec(time_t *now)
+stime_t tzoffset_sec(stime_t *now)
{
+ time_t now_ = *now;
struct tm gmt, *tmp, *lt;
gint off;
- tmp = gmtime(now);
+ tmp = gmtime(&now_);
g_return_val_if_fail(tmp != NULL, -1);
gmt = *tmp;
- lt = localtime(now);
+ lt = localtime(&now_);
g_return_val_if_fail(lt != NULL, -1);
off = (lt->tm_hour - gmt.tm_hour) * 60 + lt->tm_min - gmt.tm_min;
@@ -4414,16 +4415,17 @@ time_t tzoffset_sec(time_t *now)
}
/* calculate timezone offset (buf must not be less than 6 bytes) */
-gchar *tzoffset_buf(gchar *buf, time_t *now)
+gchar *tzoffset_buf(gchar *buf, stime_t *now)
{
+ time_t now_ = *now;
struct tm gmt, *tmp, *lt;
gint off;
gchar sign = '+';
- tmp = gmtime(now);
+ tmp = gmtime(&now_);
g_return_val_if_fail(tmp != NULL, NULL);
gmt = *tmp;
- lt = localtime(now);
+ lt = localtime(&now_);
g_return_val_if_fail(lt != NULL, NULL);
off = (lt->tm_hour - gmt.tm_hour) * 60 + lt->tm_min - gmt.tm_min;
@@ -4450,7 +4452,7 @@ gchar *tzoffset_buf(gchar *buf, time_t *now)
return buf;
}
-gchar *tzoffset(time_t *now)
+gchar *tzoffset(stime_t *now)
{
static gchar offset_string[6];
diff --git a/libsylph/utils.h b/libsylph/utils.h
index 79ece425..f93f4ce8 100644
--- a/libsylph/utils.h
+++ b/libsylph/utils.h
@@ -95,6 +95,14 @@ gint syl_link (const gchar *src,
#define HAVE_U32_TYPEDEF
#endif
+#if defined(G_OS_WIN32) && !defined(_WIN64) && defined(HAVE_64BIT_TIME_T)
+ /* for backward binary compatibility. Use only in struct definition and
+ pointer arguments. */
+ typedef gint32 stime_t;
+#else
+ typedef time_t stime_t;
+#endif
+
#ifndef BIG_ENDIAN_HOST
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
#define BIG_ENDIAN_HOST 1
@@ -514,11 +522,11 @@ gint play_sound (const gchar *file,
gboolean async);
/* time functions */
-time_t remote_tzoffset_sec (const gchar *zone);
-time_t tzoffset_sec (time_t *now);
+stime_t remote_tzoffset_sec (const gchar *zone);
+stime_t tzoffset_sec (stime_t *now);
gchar *tzoffset_buf (gchar *buf,
- time_t *now);
-gchar *tzoffset (time_t *now);
+ stime_t *now);
+gchar *tzoffset (stime_t *now);
void get_rfc822_date (gchar *buf,
gint len);
diff --git a/src/addrcache.h b/src/addrcache.h
index 46a0264f..2c574868 100644
--- a/src/addrcache.h
+++ b/src/addrcache.h
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <glib.h>
#include "addritem.h"
+#include "utils.h"
/* Address cache */
typedef struct _AddressCache AddressCache;
@@ -36,7 +37,7 @@ struct _AddressCache {
gint nextID;
gboolean dataRead;
gboolean modified;
- time_t modifyTime;
+ stime_t modifyTime;
GHashTable *itemHash;
GList *tempList;
ItemFolder *rootFolder;
diff --git a/src/jpilot.h b/src/jpilot.h
index b1ddada3..764e56f1 100644
--- a/src/jpilot.h
+++ b/src/jpilot.h
@@ -43,6 +43,7 @@
#include "addritem.h"
#include "addrcache.h"
+#include "utils.h"
typedef struct _JPilotFile JPilotFile;
@@ -58,7 +59,7 @@ struct _JPilotFile {
gint retVal;
gboolean accessFlag;
gboolean havePC3;
- time_t pc3ModifyTime;
+ stime_t pc3ModifyTime;
};
/* Limits */