summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-11-03 15:32:39 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-11-03 15:32:39 -0800
commit2ee341dc8ad2c4b95af55e1c5103a540b64430e5 (patch)
treed33ad1cb3a57ee3e1226009b1f92130c8c2ebad0
parentf1fcad1574858b48cd27e3e9b04382290243b09e (diff)
downloadssh2-rs-2ee341dc8ad2c4b95af55e1c5103a540b64430e5.zip
Fix compile on Windows
-rw-r--r--libssh2-sys/Cargo.toml1
-rw-r--r--libssh2-sys/build.rs1
-rw-r--r--libssh2-sys/lib.rs3
3 files changed, 3 insertions, 2 deletions
diff --git a/libssh2-sys/Cargo.toml b/libssh2-sys/Cargo.toml
index ca07f93..ea897dc 100644
--- a/libssh2-sys/Cargo.toml
+++ b/libssh2-sys/Cargo.toml
@@ -15,6 +15,7 @@ path = "lib.rs"
[dependencies]
libz-sys = "0.1.0"
libc = "0.2"
+ws2_32-sys = "0.1"
[target.i686-apple-darwin.dependencies]
openssl-sys = "0.6.0"
diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs
index 0d27a26..965e6a9 100644
--- a/libssh2-sys/build.rs
+++ b/libssh2-sys/build.rs
@@ -77,7 +77,6 @@ fn main() {
}
if target.contains("windows") {
- println!("cargo:rustc-link-lib=ws2_32");
println!("cargo:rustc-link-lib=bcrypt");
println!("cargo:rustc-link-lib=crypt32");
println!("cargo:rustc-link-lib=user32");
diff --git a/libssh2-sys/lib.rs b/libssh2-sys/lib.rs
index 20396f3..5f910aa 100644
--- a/libssh2-sys/lib.rs
+++ b/libssh2-sys/lib.rs
@@ -2,6 +2,7 @@
#![allow(bad_style)]
extern crate libc;
+extern crate ws2_32;
extern crate libz_sys;
#[cfg(unix)]
@@ -210,7 +211,7 @@ pub type LIBSSH2_PASSWD_CHANGEREQ_FUNC = extern fn(sess: *mut LIBSSH2_SESSION,
abstrakt: *mut *mut c_void);
#[cfg(unix)] pub type libssh2_socket_t = c_int;
-#[cfg(windows)] pub type libssh2_socket_t = libc::SOCKET;
+#[cfg(windows)] pub type libssh2_socket_t = ws2_32::SOCKET;
extern {
// misc