diff options
-rw-r--r-- | src/ir/function.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/mangling-macos.rs | 9 | ||||
-rw-r--r-- | tests/headers/mangling-macos.h | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs index 6281306b..c432a4b2 100644 --- a/src/ir/function.rs +++ b/src/ir/function.rs @@ -136,7 +136,7 @@ fn get_abi(cc: CXCallingConv) -> Abi { fn mangling_hack_if_needed(ctx: &BindgenContext, symbol: &mut String) { // NB: win64 also contains the substring "win32" in the target triple, so // we need to actually check for i686... - if ctx.target().contains("macos") || + if ctx.target().contains("darwin") || (ctx.target().contains("i686") && ctx.target().contains("windows")) { symbol.remove(0); } diff --git a/tests/expectations/tests/mangling-macos.rs b/tests/expectations/tests/mangling-macos.rs new file mode 100644 index 00000000..87df5e4a --- /dev/null +++ b/tests/expectations/tests/mangling-macos.rs @@ -0,0 +1,9 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] + + +extern "C" { + pub fn foo(); +} diff --git a/tests/headers/mangling-macos.h b/tests/headers/mangling-macos.h new file mode 100644 index 00000000..230f938b --- /dev/null +++ b/tests/headers/mangling-macos.h @@ -0,0 +1,3 @@ +// bindgen-flags: -- --target=x86_64-apple-darwin + +void foo(); |