summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-06-15 10:52:25 -0700
committerGitHub <noreply@github.com>2017-06-15 10:52:25 -0700
commitdf4dc8740c2bd0b37f3ed04d00314a8f8d89992e (patch)
tree850fa7deb05706d6712fcc35a028db369d9b3bc7
parent57468b2affd432f4da0733d6b6d0246373b07b73 (diff)
parent7faa855d01e114c1adc0abd5efd547ed40543882 (diff)
Auto merge of #752 - emilio:mangling-hack, r=bholley
ir: Correct mac target check.
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/ir/function.rs2
-rw-r--r--tests/expectations/tests/mangling-macos.rs9
-rw-r--r--tests/headers/mangling-macos.h3
5 files changed, 15 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 71b67905..e0763e1d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,6 +1,6 @@
[root]
name = "bindgen"
-version = "0.25.4"
+version = "0.25.5"
dependencies = [
"aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/Cargo.toml b/Cargo.toml
index 4c048235..d74b11ea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ name = "bindgen"
readme = "README.md"
repository = "https://github.com/servo/rust-bindgen"
documentation = "https://docs.rs/bindgen"
-version = "0.25.4"
+version = "0.25.5"
build = "build.rs"
exclude = [
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();