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:
J. Ryan Stinnett 2017-08-14 22:11:53 -05:00
parent d4b364200a
commit 22e794bbd8

View file

@ -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]