From fa0e1e50713ff76fc8eb50f4af06191b3fd630f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 8 May 2014 09:08:33 +0200 Subject: [PATCH] unix, windows: remove unneeded define --- include/uv-bsd.h | 2 -- include/uv-darwin.h | 2 -- include/uv-linux.h | 2 -- include/uv-sunos.h | 2 -- include/uv-win.h | 1 - src/uv-common.c | 6 +----- test/test-ip6-addr.c | 4 ---- 7 files changed, 1 insertion(+), 18 deletions(-) diff --git a/include/uv-bsd.h b/include/uv-bsd.h index 3458d5d7..2d72b3d7 100644 --- a/include/uv-bsd.h +++ b/include/uv-bsd.h @@ -31,6 +31,4 @@ #define UV_HAVE_KQUEUE 1 -#define UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS - #endif /* UV_BSD_H */ diff --git a/include/uv-darwin.h b/include/uv-darwin.h index 24bc35b5..d2264158 100644 --- a/include/uv-darwin.h +++ b/include/uv-darwin.h @@ -58,6 +58,4 @@ #define UV_HAVE_KQUEUE 1 -#define UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS - #endif /* UV_DARWIN_H */ diff --git a/include/uv-linux.h b/include/uv-linux.h index 62ebfe2a..9b38405a 100644 --- a/include/uv-linux.h +++ b/include/uv-linux.h @@ -31,6 +31,4 @@ void* watchers[2]; \ int wd; \ -#define UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS - #endif /* UV_LINUX_H */ diff --git a/include/uv-sunos.h b/include/uv-sunos.h index c4cd83dd..04216642 100644 --- a/include/uv-sunos.h +++ b/include/uv-sunos.h @@ -41,6 +41,4 @@ #endif /* defined(PORT_SOURCE_FILE) */ -#define UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS - #endif /* UV_SUNOS_H */ diff --git a/include/uv-win.h b/include/uv-win.h index 211c5938..64b894ee 100644 --- a/include/uv-win.h +++ b/include/uv-win.h @@ -587,4 +587,3 @@ int uv_utf16_to_utf8(const WCHAR* utf16Buffer, size_t utf16Size, int uv_utf8_to_utf16(const char* utf8Buffer, WCHAR* utf16Buffer, size_t utf16Size); -#define UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS diff --git a/src/uv-common.c b/src/uv-common.c index 96f66d6d..e6e87377 100644 --- a/src/uv-common.c +++ b/src/uv-common.c @@ -35,7 +35,7 @@ #include /* malloc */ #include /* memset */ -#if defined(UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS) && !defined(_WIN32) +#if !defined(_WIN32) # include /* if_nametoindex */ #endif @@ -107,17 +107,14 @@ int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr) { int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) { -#if defined(UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS) char address_part[40]; size_t address_part_size; const char* zone_index; -#endif memset(addr, 0, sizeof(*addr)); addr->sin6_family = AF_INET6; addr->sin6_port = htons(port); -#if defined(UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS) zone_index = strchr(ip, '%'); if (zone_index != NULL) { address_part_size = zone_index - ip; @@ -136,7 +133,6 @@ int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) { addr->sin6_scope_id = if_nametoindex(zone_index); #endif } -#endif return uv_inet_pton(AF_INET6, ip, &addr->sin6_addr); } diff --git a/test/test-ip6-addr.c b/test/test-ip6-addr.c index 0d2606ee..624b93b2 100644 --- a/test/test-ip6-addr.c +++ b/test/test-ip6-addr.c @@ -32,7 +32,6 @@ TEST_IMPL(ip6_addr_link_local) { -#ifdef UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS char string_address[INET6_ADDRSTRLEN]; uv_interface_address_t* addresses; uv_interface_address_t* address; @@ -93,9 +92,6 @@ TEST_IMPL(ip6_addr_link_local) { MAKE_VALGRIND_HAPPY(); return 0; -#else - RETURN_SKIP("Qualified link-local addresses are not supported."); -#endif }