Skip to content

Commit 0e87ec5

Browse files
committed
newlib structs as opaque
1 parent e014427 commit 0e87ec5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stm32-bindings-gen/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const STD_TO_CORE_REPLACEMENTS: &[(&str, &str)] = &[
1616
(":: std :: ptr ::", ":: core :: ptr ::"),
1717
];
1818

19+
const NEWLIB_SHARED_OPAQUES: &[&str] = &["_reent", "__sFILE", "__sFILE64"];
20+
1921
#[derive(Debug, Clone, Copy)]
2022
struct BindingSpec {
2123
module: &'static str,
@@ -272,6 +274,10 @@ impl Gen {
272274
builder = builder.clang_arg(*arg);
273275
}
274276

277+
for ty in NEWLIB_SHARED_OPAQUES {
278+
builder = builder.opaque_type(ty);
279+
}
280+
275281
for arg in arm_sysroot_args() {
276282
builder = builder.clang_arg(arg);
277283
}

0 commit comments

Comments
 (0)