[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix logic to set TIME_T_MAX; apparently, everybody had thou...



Update of /home/or/cvsroot/tor
In directory moria:/tmp/cvs-serv14595

Modified Files:
	configure.in 
Log Message:
Fix logic to set TIME_T_MAX; apparently, everybody had thought of the prospect of a signed time_t but me.

Index: configure.in
===================================================================
RCS file: /home/or/cvsroot/tor/configure.in,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -d -r1.222 -r1.223
--- configure.in	25 Jul 2005 09:12:16 -0000	1.222
+++ configure.in	25 Jul 2005 18:10:08 -0000	1.223
@@ -335,6 +335,17 @@
 AC_CHECK_SIZEOF(__int64)
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_SIZEOF(time_t)
+AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [
+AC_TRY_RUN([
+int main(int c, char**v) { if (((time_t)-1)<0) return 1; else return 0; }],
+  tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes)
+])
+
+if test $tor_cv_time_t_signed = yes; then
+  AC_DEFINE([TIME_T_IS_SIGNED], 1,
+            [Define to 1 iff time_t is signed])
+fi
+
 AC_CHECK_SIZEOF(socklen_t, , [AC_INCLUDES_DEFAULT()
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>