Skip to content

Commit dadde67

Browse files
committed
Not gnereate binding for variadic function with ms_abi
rustc fail to compile variadic function with ms_abi: error[E0045]: variadic function must have C or cdecl calling convention As suggested in issue, this short term fix: not generate binding and emit a warning. Fixes rust-lang#1281
1 parent 8f8703f commit dadde67

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/codegen/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3338,6 +3338,10 @@ impl CodeGenerator for Function {
33383338
warn!("Skipping function with thiscall ABI that isn't supported by the configured Rust target");
33393339
return;
33403340
}
3341+
Abi::Win64 if signature.is_variadic() => {
3342+
warn!("Skipping variadic function with Win64 ABI that isn't supported");
3343+
return;
3344+
}
33413345
Abi::Unknown(unknown_abi) => {
33423346
panic!(
33433347
"Invalid or unknown abi {:?} for function {:?} ({:?})",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
extern "C" {
4+
#[link_name = "\u{1}_Z1bcz"]
5+
pub fn b(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char;
6+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// bindgen-flags: -- -std=c++11
2+
3+
char __attribute__((ms_abi)) a(char, ...);
4+
char b(char, ...);

0 commit comments

Comments
 (0)