mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Fix up Servo_StyleSheet_GetOrigin 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: JHDp0XAmQCG
This commit is contained in:
parent
eb80e8f20a
commit
214c59b25e
1 changed files with 7 additions and 3 deletions
|
@ -1059,12 +1059,16 @@ pub extern "C" fn Servo_StyleSheet_SizeOfIncludingThis(
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSheet_GetOrigin(
|
||||
sheet: RawServoStyleSheetContentsBorrowed
|
||||
) -> OriginFlags {
|
||||
match StylesheetContents::as_arc(&sheet).origin {
|
||||
) -> u8 {
|
||||
let origin = match StylesheetContents::as_arc(&sheet).origin {
|
||||
Origin::UserAgent => OriginFlags_UserAgent,
|
||||
Origin::User => OriginFlags_User,
|
||||
Origin::Author => OriginFlags_Author,
|
||||
}
|
||||
};
|
||||
// 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.
|
||||
origin.0
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue