summaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-10-27 13:26:53 +0200
committerWerner Koch <wk@gnupg.org>2010-10-27 13:26:53 +0200
commit2e82b095cd2ebd3ecc1635bb5cbe65eb99de7ae7 (patch)
treeb87aea270583496526aff9f82b927f6298662451 /acinclude.m4
parentHonor TMPDIR. (diff)
downloadgnupg2-2e82b095cd2ebd3ecc1635bb5cbe65eb99de7ae7.tar.xz
gnupg2-2e82b095cd2ebd3ecc1635bb5cbe65eb99de7ae7.zip
Better support unsigned time_t
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m427
1 files changed, 25 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 28366ee38..a37e0f528 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -305,5 +305,28 @@ fi
])
-
-
+# GNUPG_TIME_T_UNSIGNED
+# Check whether time_t is unsigned
+#
+AC_DEFUN([GNUPG_TIME_T_UNSIGNED],
+ [ AC_CACHE_CHECK(whether time_t is unsigned, gnupg_cv_time_t_unsigned,
+ [AC_REQUIRE([AC_HEADER_TIME])dnl
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY(
+ [AC_INCLUDES_DEFAULT([])
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+],
+ [((time_t)-1) < 0])],
+ gnupg_cv_time_t_unsigned=no, gnupg_cv_time_t_unsigned=yes)])
+ if test $gnupg_cv_time_t_unsigned = yes; then
+ AC_DEFINE(HAVE_UNSIGNED_TIME_T,1,[Defined if time_t is an unsigned type])
+ fi
+])# GNUPG_TIME_T_UNSIGNED