aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--acconfig.h3
-rw-r--r--configure.in23
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/message-list.c9
5 files changed, 44 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c814c95b21..0efaa9e3b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-06-27 Peter Williams <peterw@curious-george.helixcode.com>
+
+ * configure.in (ctime_r): Check for whether ctime_r takes
+ two (Linux) or three (Solaris) arguments.
+
+ * acconfig.h: Add CTIME_R_THREE_ARGS to the list.
+
2000-06-26 Christopher James Lahey <clahey@helixcode.com>
* widgets/e-text/e-text.c: Calculate height including if
diff --git a/acconfig.h b/acconfig.h
index 3c6dd02c87..ebc1605516 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -20,3 +20,6 @@
/* Define this if you want to build against the development gtk */
#undef HAVE_DEVGTK
+
+/* Define if ctime_r takes three arguments */
+#undef CTIME_R_THREE_ARGS
diff --git a/configure.in b/configure.in
index 1e6b5cf2ea..16f722714b 100644
--- a/configure.in
+++ b/configure.in
@@ -111,6 +111,29 @@ fi
AC_CHECK_FUNCS(mkstemp)
dnl **************************************************
+dnl ctime_r prototype
+dnl **************************************************
+
+AC_CACHE_CHECK([if ctime_r wants three arguments], ac_cv_ctime_r_three_args,
+[
+ AC_TRY_COMPILE([
+ #include <time.h>
+ ],[
+ char *buf;
+ time_t date;
+ ctime_r( &date, buf, 100 );
+ ],[
+ ac_cv_ctime_r_three_args=yes
+ ],[
+ ac_cv_ctime_r_three_args=no
+ ])
+])
+
+if test x"$ac_cv_ctime_r_three_args" = xyes ; then
+ AC_DEFINE(CTIME_R_THREE_ARGS)
+fi
+
+dnl **************************************************
dnl * pas-backend-file stuff.
dnl * check for db_185.h. if it's there, we use it.
dnl * otherwise, we use db.h (since it'll be 185).
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 75e59f4ca8..a9eaf38b88 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-27 Peter Williams <peterw@curious-george.helixcode.com>
+
+ * message-list.c (filter_date): Solve the ctime_r problem the
+ correct way, with the magic of autoconf.
+
2000-06-27 Christopher James Lahey <clahey@helixcode.com>
* message-list.c: Work around mismatched ctime_r functions. This
diff --git a/mail/message-list.c b/mail/message-list.c
index 8c349aa1a1..cd66d3080e 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -540,8 +540,6 @@ message_list_init_images (void)
}
}
-typedef char *(*ctime_r_prototype) (const time_t *clock, ...);
-
static char *
filter_date (const void *data)
{
@@ -551,7 +549,12 @@ filter_date (const void *data)
if (date == 0)
return g_strdup ("?");
- ((ctime_r_prototype) ctime_r) (&date, buf, 26);
+#ifdef CTIME_R_THREE_ARGS
+ ctime_r (&date, buf, 26);
+#else
+ ctime_r (&date, buf);
+#endif
+
p = strchr (buf, '\n');
if (p)
*p = '\0';