]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
On Windows, tv_sec is long, not time_t.
authorNick Mathewson <nickm@torproject.org>
Thu, 16 Jun 2016 17:57:16 +0000 (13:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 16 Jun 2016 17:57:16 +0000 (13:57 -0400)
I'm not angry, Windows: just very disappointed.

src/test/test_util.c

index 6090dbdd180840112ccfd63cb4259e08eb89bab7..55aff31046899b2ffa6c3d259c655a3b8117a2db 100644 (file)
@@ -293,7 +293,12 @@ test_util_time(void *arg)
   tt_int_op(-1005000L,OP_EQ, tv_udiff(&start, &end));
   tt_int_op(-1005L,OP_EQ, tv_mdiff(&start, &end));
 
+#ifdef _WIN32
+  /* Would you believe that tv_sec is a long on windows? Of course you would.*/
+  end.tv_sec = LONG_MAX;
+#else
   end.tv_sec = TIME_MAX;
+#endif
   tt_int_op(LONG_MAX, OP_EQ, tv_udiff(&start, &end));
   tt_int_op(LONG_MAX, OP_EQ, tv_mdiff(&start, &end));