]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix test.c compilation on mingw32.
authorNick Mathewson <nickm@torproject.org>
Fri, 9 Nov 2012 01:09:06 +0000 (20:09 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 9 Nov 2012 01:18:34 +0000 (20:18 -0500)
Looks like windows doesn't have an s6_addr32 in its in6_addr.

Bug not in any released version of Tor; bugfix on abb886014e1ee.

src/test/test.c

index 9848770a84e955b754e3d7d7200f5e91ee0a71f1..1eaa65c7834550e377d0cfc9571bdb7e1ec04356 100644 (file)
@@ -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,                                                 \