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 diff --git a/Cargo.toml b/Cargo.toml index fef99bb..18d4f61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,10 +3,14 @@ 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" +[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);