summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-06-29 13:47:44 -0400
committerNick Mathewson <nickm@torproject.org>2015-06-29 13:47:44 -0400
commit753797391f789700ccf7ec9123076405f250cb93 (patch)
tree6e66310fece598fc40bf8b8f1f6976c3e0085bb3 /src
parentd9052c629b94343aef63f4e8c891c9c0a9c097b5 (diff)
downloadtor-753797391f789700ccf7ec9123076405f250cb93.tar.gz
tor-753797391f789700ccf7ec9123076405f250cb93.zip
More tweaks for windows compilation. (ick)
Diffstat (limited to 'src')
-rw-r--r--src/common/compat.h4
-rw-r--r--src/common/crypto.c1
-rw-r--r--src/or/or.h1
-rw-r--r--src/test/test_containers.c26
4 files changed, 17 insertions, 15 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index fbaeb6fe01..68985d8554 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -7,12 +7,12 @@
#define TOR_COMPAT_H
#include "orconfig.h"
-#include "torint.h"
-#include "testsupport.h"
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
+#include "torint.h"
+#include "testsupport.h"
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 984fe952e2..934679e67a 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -13,6 +13,7 @@
#include "orconfig.h"
#ifdef _WIN32
+#include <winsock2.h>
#include <windows.h>
#include <wincrypt.h>
/* Windows defines this; so does OpenSSL 0.9.8h and later. We don't actually
diff --git a/src/or/or.h b/src/or/or.h
index 0950277bba..431105b09b 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -67,6 +67,7 @@
#endif
#ifdef _WIN32
+#include <winsock2.h>
#include <io.h>
#include <process.h>
#include <direct.h>
diff --git a/src/test/test_containers.c b/src/test/test_containers.c
index 3d150f5abf..2ae81bf18d 100644
--- a/src/test/test_containers.c
+++ b/src/test/test_containers.c
@@ -887,7 +887,7 @@ static void
test_container_order_functions(void *arg)
{
int lst[25], n = 0;
- unsigned int lst2[25];
+ unsigned int lst_2[25];
// int a=12,b=24,c=25,d=60,e=77;
#define median() median_int(lst, n)
@@ -910,24 +910,24 @@ test_container_order_functions(void *arg)
tt_int_op(25,OP_EQ, median()); /* 12,12,24,25,60,77,77 */
#undef median
-#define third_quartile() third_quartile_uint32(lst2, n)
+#define third_quartile() third_quartile_uint32(lst_2, n)
n = 0;
- lst2[n++] = 1;
+ lst_2[n++] = 1;
tt_int_op(1,OP_EQ, third_quartile()); /* ~1~ */
- lst2[n++] = 2;
+ lst_2[n++] = 2;
tt_int_op(2,OP_EQ, third_quartile()); /* 1, ~2~ */
- lst2[n++] = 3;
- lst2[n++] = 4;
- lst2[n++] = 5;
+ lst_2[n++] = 3;
+ lst_2[n++] = 4;
+ lst_2[n++] = 5;
tt_int_op(4,OP_EQ, third_quartile()); /* 1, 2, 3, ~4~, 5 */
- lst2[n++] = 6;
- lst2[n++] = 7;
- lst2[n++] = 8;
- lst2[n++] = 9;
+ lst_2[n++] = 6;
+ lst_2[n++] = 7;
+ lst_2[n++] = 8;
+ lst_2[n++] = 9;
tt_int_op(7,OP_EQ, third_quartile()); /* 1, 2, 3, 4, 5, 6, ~7~, 8, 9 */
- lst2[n++] = 10;
- lst2[n++] = 11;
+ lst_2[n++] = 10;
+ lst_2[n++] = 11;
/* 1, 2, 3, 4, 5, 6, 7, 8, ~9~, 10, 11 */
tt_int_op(9,OP_EQ, third_quartile());