diff options
author | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2017-02-06 23:03:45 +0900 |
---|---|---|
committer | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2017-02-07 01:32:19 +0900 |
commit | 550d726ad2f9996f3750b90e19e440b3e8fc9fe4 (patch) | |
tree | 19c811f0c3e56a3b401b597c23bdada7857a5ccc | |
parent | fb4f421c8b9cbf80a86c9c5eb88395d7008b27a1 (diff) | |
download | servo-550d726ad2f9996f3750b90e19e440b3e8fc9fe4.tar.gz servo-550d726ad2f9996f3750b90e19e440b3e8fc9fe4.zip |
Use 'alloc' gate only for platforms which use freetype in gfx
-rw-r--r-- | components/gfx/lib.rs | 5 | ||||
-rw-r--r-- | components/gfx/platform/freetype/font_context.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index fb94e7b779f..3ada12238ac 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -6,7 +6,7 @@ #![feature(cfg_target_feature)] #![cfg_attr(any(target_os = "linux", target_os = "android"), feature(heap_api))] -#![feature(alloc)] +#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(alloc))] #![feature(box_syntax)] #![feature(plugin)] #![feature(range_contains)] @@ -16,6 +16,9 @@ #![deny(unsafe_code)] +#[cfg(any(target_os = "linux", target_os = "android"))] +extern crate alloc; + extern crate app_units; #[macro_use] extern crate bitflags; diff --git a/components/gfx/platform/freetype/font_context.rs b/components/gfx/platform/freetype/font_context.rs index 7b462798d6b..86643ae348b 100644 --- a/components/gfx/platform/freetype/font_context.rs +++ b/components/gfx/platform/freetype/font_context.rs @@ -2,8 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -extern crate alloc; - +use alloc::heap; use freetype::freetype::FT_Add_Default_Modules; use freetype::freetype::FT_Done_Library; use freetype::freetype::FT_Library; @@ -11,7 +10,6 @@ use freetype::freetype::FT_Memory; use freetype::freetype::FT_MemoryRec_; use freetype::freetype::FT_New_Library; use heapsize::{HeapSizeOf, heap_size_of}; -use self::alloc::heap; use std::os::raw::{c_long, c_void}; use std::ptr; use std::rc::Rc; |