Bug 1392447 - Fix up Servo_StyleSheet_GetOrigin for Linux 32-bit ABI. r=emilio

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:
J. Ryan Stinnett 2017-08-21 18:42:40 -05:00
Родитель 000285b465
Коммит 2c635e5c43
2 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -55,8 +55,10 @@ SERVO_BINDING_FUNC(Servo_StyleSheet_Clone, RawServoStyleSheetContentsStrong,
SERVO_BINDING_FUNC(Servo_StyleSheet_SizeOfIncludingThis, size_t,
mozilla::MallocSizeOf malloc_size_of,
RawServoStyleSheetContentsBorrowed sheet)
SERVO_BINDING_FUNC(Servo_StyleSheet_GetOrigin,
mozilla::OriginFlags,
// 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.
SERVO_BINDING_FUNC(Servo_StyleSheet_GetOrigin, uint8_t,
RawServoStyleSheetContentsBorrowed sheet)
SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSet*, RawGeckoPresContextOwned pres_context)
SERVO_BINDING_FUNC(Servo_StyleSet_RebuildCachedData, void,

Просмотреть файл

@ -466,7 +466,8 @@ ServoStyleSheet::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
OriginFlags
ServoStyleSheet::GetOrigin()
{
return Servo_StyleSheet_GetOrigin(Inner()->mContents);
return static_cast<OriginFlags>(
Servo_StyleSheet_GetOrigin(Inner()->mContents));
}
} // namespace mozilla