Skip to content

Commit

Permalink
Merge branch 'winapi-pocalypse'
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Jan 4, 2018
2 parents 2b73733 + 76ec866 commit 6b0d1a4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "c-types"
license = "MIT"
version = "1.2.0"
version = "2.0.0"
authors = ["David Hotham"]
description = """
Re-exports of cross-platform types, gathered from libc and winapi
Expand All @@ -15,4 +15,4 @@ keywords = ["libc", "winapi"]
libc = "0.2"

[target.'cfg(windows)'.dependencies]
winapi = "0.2"
winapi = { version = "0.3.3", features = ["winsock2", "ws2ipdef", "ws2tcpip"] }
66 changes: 33 additions & 33 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,47 @@

#[cfg(unix)]
mod unix {
extern crate libc;
extern crate libc;

pub type fd_set = libc::fd_set;
pub type hostent = libc::hostent;
pub type in_addr = libc::in_addr;
pub type in6_addr = libc::in6_addr;
pub type iovec = libc::iovec;
pub type sa_family_t = libc::sa_family_t;
pub type sockaddr = libc::sockaddr;
pub type sockaddr_in = libc::sockaddr_in;
pub type sockaddr_in6 = libc::sockaddr_in6;
pub type socklen_t = libc::socklen_t;
pub type fd_set = libc::fd_set;
pub type hostent = libc::hostent;
pub type in_addr = libc::in_addr;
pub type in6_addr = libc::in6_addr;
pub type iovec = libc::iovec;
pub type sa_family_t = libc::sa_family_t;
pub type sockaddr = libc::sockaddr;
pub type sockaddr_in = libc::sockaddr_in;
pub type sockaddr_in6 = libc::sockaddr_in6;
pub type socklen_t = libc::socklen_t;

pub const AF_UNSPEC: i32 = libc::AF_UNSPEC;
pub const AF_INET: i32 = libc::AF_INET;
pub const AF_INET6: i32 = libc::AF_INET6;
pub const AF_UNSPEC: i32 = libc::AF_UNSPEC;
pub const AF_INET: i32 = libc::AF_INET;
pub const AF_INET6: i32 = libc::AF_INET6;
}

#[cfg(windows)]
mod windows {
extern crate libc;
extern crate winapi;
extern crate libc;
extern crate winapi;

pub type fd_set = winapi::fd_set;
pub type hostent = winapi::winsock2::hostent;
pub type in_addr = winapi::in_addr;
pub type in6_addr = winapi::in6_addr;
#[repr(C)]
pub struct iovec {
pub iov_base: *mut libc::c_void,
pub iov_len: libc::size_t,
}
pub type sa_family_t = winapi::ws2def::ADDRESS_FAMILY;
pub type sockaddr = winapi::SOCKADDR;
pub type sockaddr_in = winapi::ws2def::SOCKADDR_IN;
pub type sockaddr_in6 = winapi::ws2ipdef::sockaddr_in6;
pub type socklen_t = winapi::socklen_t;
pub type fd_set = winapi::um::winsock2::fd_set;
pub type hostent = winapi::um::winsock2::hostent;
pub type in_addr = winapi::shared::inaddr::in_addr;
pub type in6_addr = winapi::shared::in6addr::in6_addr;
#[repr(C)]
pub struct iovec {
pub iov_base: *mut libc::c_void,
pub iov_len: libc::size_t,
}
pub type sa_family_t = winapi::shared::ws2def::ADDRESS_FAMILY;
pub type sockaddr = winapi::shared::ws2def::SOCKADDR;
pub type sockaddr_in = winapi::shared::ws2def::SOCKADDR_IN;
pub type sockaddr_in6 = winapi::shared::ws2ipdef::SOCKADDR_IN6_LH;
pub type socklen_t = winapi::um::ws2tcpip::socklen_t;

pub const AF_UNSPEC: i32 = winapi::ws2def::AF_UNSPEC;
pub const AF_INET: i32 = winapi::ws2def::AF_INET;
pub const AF_INET6: i32 = winapi::ws2def::AF_INET6;
pub const AF_UNSPEC: i32 = winapi::shared::ws2def::AF_UNSPEC;
pub const AF_INET: i32 = winapi::shared::ws2def::AF_INET;
pub const AF_INET6: i32 = winapi::shared::ws2def::AF_INET6;
}

#[cfg(unix)]
Expand Down

0 comments on commit 6b0d1a4

Please sign in to comment.