diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-09-11 17:07:49 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-09-19 15:11:00 +1200 |
| commit | ce0907e46e8e1aa23ee39f69e4f628f68bfbb0d7 (patch) | |
| tree | 9ea529bfee7d62b85288d37b0e2bbcdd1c866e0d /src/libnative | |
| parent | af3889f6979647b9bd2dc5f5132d80e3e5b405a5 (diff) | |
| download | rust-ce0907e46e8e1aa23ee39f69e4f628f68bfbb0d7.tar.gz rust-ce0907e46e8e1aa23ee39f69e4f628f68bfbb0d7.zip | |
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.
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/net.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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 |
