diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-06-15 19:47:58 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-06-15 19:48:49 +0200 |
commit | a52bc37ec3bbfc9f83331a479ad2166d44262a8d (patch) | |
tree | 7bfedf5b59dfb416c5936b76cc2362c3b7529146 | |
parent | 78896f9d1a62a986665e5eb0f2b55ffae79eb986 (diff) |
ir: Correct mac target check.
Because I'm stupid.
-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(); |