From f2c0aba3525180d2a1b2eaaf013de561ec8b3b15 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 5 Jun 2020 16:57:50 +0200 Subject: [PATCH] C API: Only use foreign-types on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its only use is for CoreAnimationLayerRef::from_ptr() in PFMetalDeviceCreate, so this fixes a warning on other platforms. The last time I tried to fix this warning I didn’t notice that it was actually used, and thus 2d2bc14e5cb597bc9c8f602d28c4a16902fd1938 broke the macOS build in #257. --- c/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c/src/lib.rs b/c/src/lib.rs index d1fd1754..4c65a40b 100644 --- a/c/src/lib.rs +++ b/c/src/lib.rs @@ -11,7 +11,6 @@ //! C bindings to Pathfinder. use font_kit::handle::Handle; -use foreign_types::ForeignTypeRef; use gl; use pathfinder_canvas::{Canvas, CanvasFontContext, CanvasRenderingContext2D, FillStyle, LineJoin}; use pathfinder_canvas::{Path2D, TextAlign, TextMetrics}; @@ -42,6 +41,8 @@ use std::str; use metal::{CAMetalLayer, CoreAnimationLayerRef, Device}; #[cfg(all(target_os = "macos", not(feature = "pf-gl")))] use pathfinder_metal::MetalDevice; +#[cfg(all(target_os = "macos", not(feature = "pf-gl")))] +use foreign_types::ForeignTypeRef; // Constants