mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix up Servo_TakeChangeHint 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: 6qqVVfU8Mb2
This commit is contained in:
parent
d4b364200a
commit
22e794bbd8
1 changed files with 5 additions and 2 deletions
|
@ -2831,7 +2831,7 @@ pub extern "C" fn Servo_NoteExplicitHints(element: RawGeckoElementBorrowed,
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
|
||||
was_restyled: *mut bool) -> nsChangeHint
|
||||
was_restyled: *mut bool) -> u32
|
||||
{
|
||||
let mut was_restyled = unsafe { was_restyled.as_mut().unwrap() };
|
||||
let element = GeckoElement(element);
|
||||
|
@ -2852,7 +2852,10 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
|
|||
};
|
||||
|
||||
debug!("Servo_TakeChangeHint: {:?}, damage={:?}", element, damage);
|
||||
damage.as_change_hint()
|
||||
// We'd like to return `nsChangeHint` 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.
|
||||
damage.as_change_hint().0
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue