summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-11-08 20:09:06 -0500
committerNick Mathewson <nickm@torproject.org>2012-11-08 20:18:34 -0500
commit8b5d95db0df18bca6e608e95248340cf7f67b673 (patch)
tree48a586a914388af9076e3699c3346f01a60be12f /src/test
parent08436b27ffba4094760fd1fe5321bbd255043b53 (diff)
downloadtor-8b5d95db0df18bca6e608e95248340cf7f67b673.tar.gz
tor-8b5d95db0df18bca6e608e95248340cf7f67b673.zip
Fix test.c compilation on mingw32.
Looks like windows doesn't have an s6_addr32 in its in6_addr. Bug not in any released version of Tor; bugfix on abb886014e1ee.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 9848770a84..1eaa65c783 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1547,7 +1547,10 @@ test_geoip(void)
memset(&in6, 0, sizeof(in6));
/* Make sure that country ID actually works. */
-#define SET_TEST_IPV6(i) in6.s6_addr32[3] = htonl((uint32_t) i)
+#define SET_TEST_IPV6(i) \
+ do { \
+ set_uint32(in6.s6_addr + 12, htonl((uint32_t) (i))); \
+ } while (0)
#define CHECK_COUNTRY(country, val) do { \
/* test ipv4 country lookup */ \
test_streq(country, \