Files
servo/components/background_hang_monitor/lib.rs
nortti0 11687b3263 Port Servo to FreeBSD (#43116)
Add the minimum amount of FreeBSD-specific code to Servo, where no
platform-neutral fallback exists.

Testing: I've succesfully built and run Servo on FreeBSD with these
changes (and some fixes to dependencies). There's no functional change
to any other targets. This pull request was created with Servo running
on FreeBSD.
Fixes: #11625

---------

Signed-off-by: Juhani Krekelä <juhani@krekelä.fi>
Co-authored-by: Juhani Krekelä <juhani@krekelä.fi>
2026-03-31 14:11:13 +00:00

64 lines
1.8 KiB
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#![deny(unsafe_code)]
pub mod background_hang_monitor;
mod sampler;
#[cfg(all(
feature = "sampler",
target_os = "linux",
not(any(
target_arch = "arm",
target_arch = "aarch64",
target_env = "ohos",
target_env = "musl"
))
))]
mod sampler_linux;
#[cfg(all(feature = "sampler", target_os = "android"))]
mod sampler_linux;
#[cfg(all(feature = "sampler", target_os = "macos"))]
mod sampler_mac;
#[cfg(all(feature = "sampler", target_os = "windows"))]
mod sampler_windows;
pub use self::background_hang_monitor::*;
#[cfg(any(
not(feature = "sampler"),
all(
target_os = "linux",
any(
target_arch = "arm",
target_arch = "aarch64",
target_env = "ohos",
target_env = "musl"
)
),
all(target_os = "windows", target_arch = "aarch64"),
target_os = "freebsd"
))]
pub(crate) use crate::sampler::DummySampler as SamplerImpl;
#[cfg(all(
feature = "sampler",
target_os = "linux",
not(any(
target_arch = "arm",
target_arch = "aarch64",
target_env = "ohos",
target_env = "musl"
))
))]
pub(crate) use crate::sampler_linux::LinuxSampler as SamplerImpl;
#[cfg(all(feature = "sampler", target_os = "android"))]
pub(crate) use crate::sampler_linux::LinuxSampler as SamplerImpl;
#[cfg(all(feature = "sampler", target_os = "macos"))]
pub(crate) use crate::sampler_mac::MacOsSampler as SamplerImpl;
#[cfg(all(
feature = "sampler",
target_os = "windows",
any(target_arch = "x86_64", target_arch = "x86")
))]
pub(crate) use crate::sampler_windows::WindowsSampler as SamplerImpl;