summaryrefslogtreecommitdiff
path: root/deps/uv/test/task.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/test/task.h')
-rw-r--r--deps/uv/test/task.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/deps/uv/test/task.h b/deps/uv/test/task.h
index e890c77fe1..07584c5299 100644
--- a/deps/uv/test/task.h
+++ b/deps/uv/test/task.h
@@ -39,6 +39,11 @@
# include <sys/resource.h> /* setrlimit() */
#endif
+#ifdef __clang__
+# pragma clang diagnostic ignored "-Wvariadic-macros"
+# pragma clang diagnostic ignored "-Wc99-extensions"
+#endif
+
#define TEST_PORT 9123
#define TEST_PORT_2 9124
@@ -229,4 +234,21 @@ UNUSED static void close_loop(uv_loop_t* loop) {
uv_run(loop, UV_RUN_DEFAULT);
}
+UNUSED static int can_ipv6(void) {
+ uv_interface_address_t* addr;
+ int supported;
+ int count;
+ int i;
+
+ if (uv_interface_addresses(&addr, &count))
+ return 1; /* Assume IPv6 support on failure. */
+
+ supported = 0;
+ for (i = 0; supported == 0 && i < count; i += 1)
+ supported = (AF_INET6 == addr[i].address.address6.sin6_family);
+
+ uv_free_interface_addresses(addr, count);
+ return supported;
+}
+
#endif /* TASK_H_ */