summaryrefslogtreecommitdiff
path: root/systest
diff options
context:
space:
mode:
authorWez Furlong <wez@wezfurlong.org>2019-07-29 14:03:34 -0700
committerWez Furlong <wez@wezfurlong.org>2019-07-31 14:21:50 -0700
commit3aa8096bc4e1c6c762f8553c516b5ce099ba5f71 (patch)
tree87daf4fefb6814697e8ac7309e5892456cfc7e6b /systest
parentff790796728ed74ff29cded408622117ebf0e64f (diff)
downloadssh2-rs-3aa8096bc4e1c6c762f8553c516b5ce099ba5f71.zip
Fix scp_recv ABI issue on Windows
* Adopt scp_recv2 instead, which uses compatible 64-bit stat types * Mark scp_recv as deprecated * small version bump Fixes https://github.com/alexcrichton/ssh2-rs/issues/109 Refs https://github.com/alexcrichton/ssh2-rs/pull/117 Co-authored-by: Joyce Babu <joyce@ennexa.com>
Diffstat (limited to 'systest')
-rw-r--r--systest/build.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/systest/build.rs b/systest/build.rs
index 6131643..7d5c281 100644
--- a/systest/build.rs
+++ b/systest/build.rs
@@ -9,9 +9,18 @@ fn main() {
.header("libssh2_sftp.h")
.include(env::var("DEP_SSH2_INCLUDE").unwrap())
.type_name(|s, is_struct| {
- if (is_struct || s == "stat") && !s.starts_with("LIB") {
+ if s == "stat" {
+ // Ensure that we emit `struct stat` rather than just a `stat` typedef.
+ format!("struct stat")
+ } else if s == "libssh2_struct_stat" {
+ // libssh2_struct_stat is a typedef so ensure that we don't emit
+ // `struct libssh2_struct_stat` in the C code we generate
+ s.to_string()
+ } else if is_struct && !s.starts_with("LIB") {
+ // Otherwise we prefer to emit `struct foo` unless the type is `LIB_XXX`
format!("struct {}", s)
} else {
+ // All other cases: just emit the type name
s.to_string()
}
})