From 25d2b7025213e2af99293011f8a23b5e13971c6a Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 15 Aug 2017 17:10:13 -0500 Subject: [PATCH] Fix up Servo_StyleSet_MediumFeaturesChanged for Linux 32-bit ABI Bindgen bitfield enums don't work as return values with the Linux 32-bit ABI at the moment because they wrap the value in a struct. This causes the Rust side to believe the caller will pass along space for the struct return value, while C++ believes it's just an integer value. MozReview-Commit-ID: LY6z7lEKgOp --- ports/geckolib/glue.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 68742d004a7..9c620b35e70 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -900,7 +900,7 @@ pub extern "C" fn Servo_StyleSet_AppendStyleSheet( pub extern "C" fn Servo_StyleSet_MediumFeaturesChanged( raw_data: RawServoStyleSetBorrowed, viewport_units_used: *mut bool, -) -> OriginFlags { +) -> u8 { let global_style_data = &*GLOBAL_STYLE_DATA; let guard = global_style_data.shared_lock.read(); @@ -926,7 +926,10 @@ pub extern "C" fn Servo_StyleSet_MediumFeaturesChanged( &guard, ); - OriginFlags::from(origins_in_which_rules_changed) + // We'd like to return `OriginFlags` here, but bindgen bitfield enums don't + // work as return values with the Linux 32-bit ABI at the moment because + // they wrap the value in a struct, so for now just unwrap it. + OriginFlags::from(origins_in_which_rules_changed).0 } #[no_mangle]