aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-06-15 16:31:36 +0200
committerGitHub <noreply@github.com>2024-06-15 14:31:36 +0000
commit7982f0dc27cad98057a0a953cca76e2b86aa37ed (patch)
tree46b099559da27d59cd29eabcc7e98a466da2f47d /components/gfx
parent6b6872831ccc83e37dc9a8b1842c125606943d69 (diff)
downloadservo-7982f0dc27cad98057a0a953cca76e2b86aa37ed.tar.gz
servo-7982f0dc27cad98057a0a953cca76e2b86aa37ed.zip
build: Fix build warnings on Windows (#32500)
Disable some code for Windows, which is causing build warnings. When it cannot be easily disabled (mainly for the incomplete BHM and sandbox feature), allow dead code.
Diffstat (limited to 'components/gfx')
-rw-r--r--components/gfx/font.rs1
-rw-r--r--components/gfx/platform/mod.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/components/gfx/font.rs b/components/gfx/font.rs
index 1ea59c73fd5..89553b80990 100644
--- a/components/gfx/font.rs
+++ b/components/gfx/font.rs
@@ -831,6 +831,7 @@ impl FontFamilyDescriptor {
/// ];
/// let mapped_weight = apply_font_config_to_style_mapping(&mapping, weight as f64);
/// ```
+#[cfg(any(target_os = "linux", target_os = "macos"))]
pub(crate) fn map_platform_values_to_style_values(mapping: &[(f64, f64)], value: f64) -> f64 {
if value < mapping[0].0 {
return mapping[0].1;
diff --git a/components/gfx/platform/mod.rs b/components/gfx/platform/mod.rs
index f445d83e75c..542c6ab0aed 100644
--- a/components/gfx/platform/mod.rs
+++ b/components/gfx/platform/mod.rs
@@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+#[cfg(any(target_os = "linux", target_os = "macos"))]
use base::text::{UnicodeBlock, UnicodeBlockMethod};
+#[cfg(any(target_os = "linux", target_os = "macos"))]
use unicode_script::Script;
#[cfg(any(target_os = "linux", target_os = "android"))]
@@ -11,6 +13,7 @@ pub use crate::platform::freetype::{font, font_list, library_handle};
pub use crate::platform::macos::{core_text_font_cache, font, font_list};
#[cfg(target_os = "windows")]
pub use crate::platform::windows::{font, font_list};
+#[cfg(any(target_os = "linux", target_os = "macos"))]
use crate::text::FallbackFontSelectionOptions;
#[cfg(any(target_os = "linux", target_os = "android"))]