diff src/configure.in @ 2232:2e6906bbc5f4 vim73

A few more fixes for undo file. Split test in two parts so that it doesn't fail with tiny features.
author Bram Moolenaar <bram@vim.org>
date Sun, 30 May 2010 13:26:21 +0200
parents 99ba9a30755a
children 60da25e3aab7
line wrap: on
line diff
--- a/src/configure.in
+++ b/src/configure.in
@@ -2988,6 +2988,29 @@ main()
 AC_MSG_RESULT($ac_cv_sizeof_int)
 AC_DEFINE_UNQUOTED(SIZEOF_INT, $ac_cv_sizeof_int)
 
+dnl Figure out sizeof(time_t) so that it can be used in #ifdef.
+AC_MSG_CHECKING(size of time_t)
+AC_CACHE_VAL(ac_cv_sizeof_time_t,
+	[AC_TRY_RUN([
+#include <stdio.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#endif
+#include <time.h>
+main()
+{
+  FILE *f=fopen("conftestval", "w");
+  if (!f) exit(1);
+  fprintf(f, "%d\n", (int)sizeof(time_t));
+  exit(0);
+}],
+	    ac_cv_sizeof_time_t=`cat conftestval`,
+	    AC_MSG_ERROR([failed to determine sizeof(time_t)]),
+	    AC_MSG_ERROR([failed to compile test program]))])
+AC_MSG_RESULT($ac_cv_sizeof_time_t)
+AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t)
+
 dnl Make sure that uint32_t is really 32 bits unsigned.
 AC_MSG_CHECKING([uint32_t is 32 bits])
 AC_TRY_RUN([