From ce0907e46e8e1aa23ee39f69e4f628f68bfbb0d7 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Thu, 11 Sep 2014 17:07:49 +1200 Subject: Add enum variants to the type namespace Change to resolve and update compiler and libs for uses. [breaking-change] Enum variants are now in both the value and type namespaces. This means that if you have a variant with the same name as a type in scope in a module, you will get a name clash and thus an error. The solution is to either rename the type or the variant. --- src/libnative/io/net.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libnative') diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index af7508ccbe9..8418e741167 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -37,7 +37,7 @@ pub fn ntohs(u: u16) -> u16 { } enum InAddr { - InAddr(libc::in_addr), + In4Addr(libc::in_addr), In6Addr(libc::in6_addr), } @@ -48,7 +48,7 @@ fn ip_to_inaddr(ip: rtio::IpAddr) -> InAddr { (b as u32 << 16) | (c as u32 << 8) | (d as u32 << 0); - InAddr(libc::in_addr { + In4Addr(libc::in_addr { s_addr: Int::from_be(ip) }) } @@ -74,7 +74,7 @@ fn addr_to_sockaddr(addr: rtio::SocketAddr, -> libc::socklen_t { unsafe { let len = match ip_to_inaddr(addr.ip) { - InAddr(inaddr) => { + In4Addr(inaddr) => { let storage = storage as *mut _ as *mut libc::sockaddr_in; (*storage).sin_family = libc::AF_INET as libc::sa_family_t; (*storage).sin_port = htons(addr.port); @@ -723,7 +723,7 @@ impl UdpSocket { pub fn set_membership(&mut self, addr: rtio::IpAddr, opt: libc::c_int) -> IoResult<()> { match ip_to_inaddr(addr) { - InAddr(addr) => { + In4Addr(addr) => { let mreq = libc::ip_mreq { imr_multiaddr: addr, // interface == INADDR_ANY -- cgit 1.4.1-3-g733a5