diff --git a/gen/include.rs b/gen/include.rs index e3a9dd790..8f38fe385 100644 --- a/gen/include.rs +++ b/gen/include.rs @@ -38,6 +38,7 @@ pub struct Includes { pub string: bool, pub type_traits: bool, pub utility: bool, + pub base_tsd: bool, } impl Includes { @@ -88,6 +89,11 @@ impl Display for Includes { if self.utility { writeln!(f, "#include ")?; } + if self.base_tsd { + writeln!(f, "#if defined(_WIN32)")?; + writeln!(f, "#include ")?; + writeln!(f, "#endif")?; + } if *self != Self::default() { writeln!(f)?; } diff --git a/gen/write.rs b/gen/write.rs index 9d6ef6e45..d80e95795 100644 --- a/gen/write.rs +++ b/gen/write.rs @@ -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 => {