Skip to content

Commit

Permalink
Fix up Servo_StyleSet_Init for Linux 32-bit ABI
Browse files Browse the repository at this point in the history
Rust was treating this as returning an `Owned` types which uses a struct, while
C++ saw it as just a pointer.

This disagreement violates the Linux 32-bit ABI, and also the pointer was deemed
to be more correct anyway.

MozReview-Commit-ID: AQJkdU02vfh
  • Loading branch information
jryans committed Aug 16, 2017
1 parent eba8961 commit 2d65fc8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ports/geckolib/glue.rs
Expand Up @@ -62,6 +62,7 @@ use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowedMut;
use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
use style::gecko_bindings::bindings::RawServoAnimationValueTableBorrowed;
use style::gecko_bindings::bindings::RawServoStyleRuleBorrowed;
use style::gecko_bindings::bindings::RawServoStyleSet;
use style::gecko_bindings::bindings::ServoStyleContextBorrowedOrNull;
use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowed;
Expand Down Expand Up @@ -91,7 +92,7 @@ use style::gecko_bindings::structs::nsIDocument;
use style::gecko_bindings::structs::nsStyleTransformMatrix::MatrixTransformOperator;
use style::gecko_bindings::structs::nsTArray;
use style::gecko_bindings::structs::nsresult;
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI};
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI};
use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong};
use style::gecko_bindings::sugar::refptr::RefPtr;
use style::gecko_properties::style_structs;
Expand Down Expand Up @@ -1924,9 +1925,9 @@ pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(values: ServoStyleContex
/// device alive).
#[no_mangle]
pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned)
-> RawServoStyleSetOwned {
-> *mut RawServoStyleSet {
let data = Box::new(PerDocumentStyleData::new(pres_context));
data.into_ffi()
Box::into_raw(data) as *mut RawServoStyleSet
}

#[no_mangle]
Expand Down

0 comments on commit 2d65fc8

Please sign in to comment.