C API: Only use foreign-types on macOS

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 2d2bc14e5c broke
the macOS build in #257.
This commit is contained in:
Emmanuel Gil Peyrot 2020-06-05 16:57:50 +02:00
parent 0f35009215
commit f2c0aba352
1 changed files with 2 additions and 1 deletions

View File

@ -11,7 +11,6 @@
//! C bindings to Pathfinder. //! C bindings to Pathfinder.
use font_kit::handle::Handle; use font_kit::handle::Handle;
use foreign_types::ForeignTypeRef;
use gl; use gl;
use pathfinder_canvas::{Canvas, CanvasFontContext, CanvasRenderingContext2D, FillStyle, LineJoin}; use pathfinder_canvas::{Canvas, CanvasFontContext, CanvasRenderingContext2D, FillStyle, LineJoin};
use pathfinder_canvas::{Path2D, TextAlign, TextMetrics}; use pathfinder_canvas::{Path2D, TextAlign, TextMetrics};
@ -42,6 +41,8 @@ use std::str;
use metal::{CAMetalLayer, CoreAnimationLayerRef, Device}; use metal::{CAMetalLayer, CoreAnimationLayerRef, Device};
#[cfg(all(target_os = "macos", not(feature = "pf-gl")))] #[cfg(all(target_os = "macos", not(feature = "pf-gl")))]
use pathfinder_metal::MetalDevice; use pathfinder_metal::MetalDevice;
#[cfg(all(target_os = "macos", not(feature = "pf-gl")))]
use foreign_types::ForeignTypeRef;
// Constants // Constants