mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Fix Servo build.
This commit is contained in:
parent
cccac2cedd
commit
8c6fe09dce
5 changed files with 55 additions and 6 deletions
|
@ -73,6 +73,10 @@ pub struct CalcVariant {
|
|||
ptr: *mut CalcLengthPercentage,
|
||||
}
|
||||
|
||||
// `CalcLengthPercentage` is `Send + Sync` as asserted below.
|
||||
unsafe impl Send for CalcVariant {}
|
||||
unsafe impl Sync for CalcVariant {}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[derive(Copy, Clone)]
|
||||
#[repr(C)]
|
||||
|
@ -130,10 +134,14 @@ enum Tag {
|
|||
// All the members should be 64 bits, even in 32-bit builds.
|
||||
#[allow(unused)]
|
||||
unsafe fn static_assert() {
|
||||
fn assert_send_and_sync<T: Send + Sync>() {}
|
||||
std::mem::transmute::<u64, LengthVariant>(0u64);
|
||||
std::mem::transmute::<u64, PercentageVariant>(0u64);
|
||||
std::mem::transmute::<u64, CalcVariant>(0u64);
|
||||
std::mem::transmute::<u64, LengthPercentage>(0u64);
|
||||
assert_send_and_sync::<LengthVariant>();
|
||||
assert_send_and_sync::<PercentageVariant>();
|
||||
assert_send_and_sync::<CalcLengthPercentage>();
|
||||
}
|
||||
|
||||
impl Drop for LengthPercentage {
|
||||
|
|
|
@ -881,7 +881,17 @@ impl CalcNode {
|
|||
return Ok(MathFunction::Calc);
|
||||
}
|
||||
|
||||
if !static_prefs::pref!("layout.css.comparison-functions.enabled") {
|
||||
#[cfg(feature = "gecko")]
|
||||
fn comparison_functions_enabled() -> bool {
|
||||
static_prefs::pref!("layout.css.comparison-functions.enabled")
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
fn comparison_functions_enabled() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
if !comparison_functions_enabled() {
|
||||
return Err(location.new_unexpected_token_error(Token::Function(name.clone())));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue