[tor-commits] [tor/master] Fix windows compilation in compat_time

nickm at torproject.org nickm at torproject.org
Thu Jun 28 19:21:00 UTC 2018


commit 0f02d2c0411448668d2dfe11b61e1ea72ee7a3b2
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Jun 28 13:40:21 2018 -0400

    Fix windows compilation in compat_time
    
    We need to use lib/fs/winlib.h here so that we can use
    GetTickCount64.
    
    I would love to declare that XP is dead, and everybody has
    GetTickCount64.
---
 Makefile.am                | 62 +++++++++++++++++++++++-----------------------
 src/lib/time/.may_include  |  3 +++
 src/lib/time/compat_time.c |  2 ++
 3 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d28eb6149..162e56e76 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,51 +40,51 @@ endif
 # "Common" libraries used to link tor's utility code.
 TOR_UTIL_LIBS = \
 	src/common/libor.a \
-        src/lib/libtor-process.a \
-        src/lib/libtor-fs.a \
-        src/lib/libtor-encoding.a \
-        src/lib/libtor-sandbox.a \
+	src/lib/libtor-process.a \
+	src/lib/libtor-time.a \
+	src/lib/libtor-fs.a \
+	src/lib/libtor-encoding.a \
+	src/lib/libtor-sandbox.a \
 	src/lib/libtor-container.a \
 	src/lib/libtor-net.a \
-        src/lib/libtor-thread.a \
-        src/lib/libtor-memarea.a \
+	src/lib/libtor-thread.a \
+	src/lib/libtor-memarea.a \
 	src/lib/libtor-math.a \
-	src/lib/libtor-time.a \
-        src/lib/libtor-log.a \
-        src/lib/libtor-lock.a \
-        src/lib/libtor-fdio.a \
-        src/lib/libtor-string.a \
-        src/lib/libtor-smartlist-core.a \
+	src/lib/libtor-log.a \
+	src/lib/libtor-lock.a \
+	src/lib/libtor-fdio.a \
+	src/lib/libtor-string.a \
+	src/lib/libtor-smartlist-core.a \
 	src/lib/libtor-malloc.a \
-        src/lib/libtor-wallclock.a \
-        src/lib/libtor-err.a \
-        src/lib/libtor-intmath.a \
+	src/lib/libtor-wallclock.a \
+	src/lib/libtor-err.a \
+	src/lib/libtor-intmath.a \
 	src/lib/libtor-ctime.a
 
 # Variants of the above for linking the testing variant of tor (for coverage
 # and tests)
 TOR_UTIL_TESTING_LIBS = \
 	src/common/libor-testing.a \
-        src/lib/libtor-process-testing.a \
-        src/lib/libtor-fs-testing.a \
-        src/lib/libtor-encoding-testing.a \
-        src/lib/libtor-sandbox-testing.a \
+	src/lib/libtor-process-testing.a \
+	src/lib/libtor-time-testing.a \
+	src/lib/libtor-fs-testing.a \
+	src/lib/libtor-encoding-testing.a \
+	src/lib/libtor-sandbox-testing.a \
 	src/lib/libtor-container-testing.a \
 	src/lib/libtor-net-testing.a \
-        src/lib/libtor-thread-testing.a \
-        src/lib/libtor-memarea-testing.a \
+	src/lib/libtor-thread-testing.a \
+	src/lib/libtor-memarea-testing.a \
 	src/lib/libtor-math-testing.a \
-	src/lib/libtor-time-testing.a \
-        src/lib/libtor-log-testing.a \
-        src/lib/libtor-lock-testing.a \
-        src/lib/libtor-fdio-testing.a \
-        src/lib/libtor-string-testing.a \
-        src/lib/libtor-smartlist-core-testing.a \
+	src/lib/libtor-log-testing.a \
+	src/lib/libtor-lock-testing.a \
+	src/lib/libtor-fdio-testing.a \
+	src/lib/libtor-string-testing.a \
+	src/lib/libtor-smartlist-core-testing.a \
 	src/lib/libtor-malloc-testing.a \
-        src/lib/libtor-wallclock-testing.a \
-        src/lib/libtor-err-testing.a \
-        src/lib/libtor-intmath.a \
-        src/lib/libtor-ctime-testing.a
+	src/lib/libtor-wallclock-testing.a \
+	src/lib/libtor-err-testing.a \
+	src/lib/libtor-intmath.a \
+	src/lib/libtor-ctime-testing.a
 
 # Internal crypto libraries used in Tor
 TOR_CRYPTO_LIBS = \
diff --git a/src/lib/time/.may_include b/src/lib/time/.may_include
index a35e7a34e..2c7e37a83 100644
--- a/src/lib/time/.may_include
+++ b/src/lib/time/.may_include
@@ -6,3 +6,6 @@ lib/intmath/*.h
 lib/log/*.h
 lib/time/*.h
 lib/wallclock/*.h
+
+# For load_windows_system_lib.
+lib/fs/winlib.h
\ No newline at end of file
diff --git a/src/lib/time/compat_time.c b/src/lib/time/compat_time.c
index f50ccb5e3..08f99b70c 100644
--- a/src/lib/time/compat_time.c
+++ b/src/lib/time/compat_time.c
@@ -16,6 +16,8 @@
 #include "lib/log/torlog.h"
 #include "lib/log/util_bug.h"
 #include "lib/intmath/muldiv.h"
+#include "lib/fs/winlib.h"
+#include "lib/wallclock/timeval.h"
 
 #ifdef _WIN32
 #include <winsock2.h>





More information about the tor-commits mailing list