Skip to content

Commit

Permalink
Include BaseTsd.h to get SSIZE_T
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 10, 2020
1 parent b8a6fb2 commit 6ba8a67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gen/include.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub struct Includes {
pub string: bool,
pub type_traits: bool,
pub utility: bool,
pub base_tsd: bool,
}

impl Includes {
Expand Down Expand Up @@ -88,6 +89,11 @@ impl Display for Includes {
if self.utility {
writeln!(f, "#include <utility>")?;
}
if self.base_tsd {
writeln!(f, "#if defined(_WIN32)")?;
writeln!(f, "#include <BaseTsd.h>")?;
writeln!(f, "#endif")?;
}
if *self != Self::default() {
writeln!(f)?;
}
Expand Down
1 change: 1 addition & 0 deletions gen/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ fn write_include_cxxbridge(out: &mut OutFile, apis: &[Api], types: &Types) {
needs_rust_fn = true;
}
ty if ty == Isize => {
out.include.base_tsd = true;
needs_rust_isize = true;
}
ty if ty == RustString => {
Expand Down

0 comments on commit 6ba8a67

Please sign in to comment.