From 0b08242836fc15531d9b0aeb952640caf21ea967 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 13 Jan 2017 11:01:45 -0500 Subject: [PATCH 1/3] Hide features from macOS 10.11 behind a feature. --- Cargo.toml | 4 ++++ src/event.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index fef99bb..1a9f7c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,10 @@ version = "0.4.3" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" +[features] +default = [] +elcapitan = [] + [dependencies] libc = "0.2" core-foundation = "0.2" diff --git a/src/event.rs b/src/event.rs index b193426..f68b8a7 100644 --- a/src/event.rs +++ b/src/event.rs @@ -204,6 +204,7 @@ impl CGEvent { } } + #[cfg(feature = "elcapitan")] pub fn post_to_pid(&self, pid: libc::pid_t) { unsafe { CGEventPostToPid(pid, self.as_concrete_TypeRef()); @@ -268,6 +269,7 @@ extern { /// taps. fn CGEventPost(tapLocation: CGEventTapLocation, event: CGEventRef); + #[cfg(feature = "elcapitan")] /// Post an event to a specified process ID fn CGEventPostToPid(pid: libc::pid_t, event: CGEventRef); From 495c81d35fb4a4f15133c347a30831438d21dd18 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 13 Jan 2017 11:02:24 -0500 Subject: [PATCH 2/3] Breaking change version bump. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1a9f7c9..18d4f61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "core-graphics" description = "Bindings to Core Graphics for OS X" homepage = "https://github.com/servo/core-graphics-rs" repository = "https://github.com/servo/core-graphics-rs" -version = "0.4.3" +version = "0.5.0" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" From 5afc7df3af1bed1c08eee6507799d65ecfdf5ac7 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 13 Jan 2017 11:03:48 -0500 Subject: [PATCH 3/3] Test with features and without. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 19ef02b..f741543 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,9 @@ rust: - beta - stable +script: + - cargo test + - cargo test --features="elcapitan" + notifications: webhooks: http://build.servo.org:54856/travis