From 6c851c88ead12c652897b9e53369e9c2f085f50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 25 Mar 2016 18:03:12 +0100 Subject: [PATCH] geckolib: Update bindings with vtable generation and anonymous unions Only 9 tests failing! ``` bindgen_test_layout_FontFamilyList bindgen_test_layout_StyleAnimation bindgen_test_layout_nsFont bindgen_test_layout_nsStyleBackground bindgen_test_layout_nsStyleDisplay bindgen_test_layout_nsStyleFont bindgen_test_layout_nsStyleGridTemplate bindgen_test_layout_nsStylePosition bindgen_test_layout_nsStyleSVG ``` The dependencies are: * FontFamilyList makes nsFont fail which makes nsStyleFont fail. * nsStyleGridTemplate makes nsStylePosition fail * StyleAnimation makes nsStyleDisplay fail nsStyleGridTemplate and nsStyleSVG failures seem to be bitfield-related. Except the bitfield-related values and those deps, I don't know what might cause the other failures, we'll have to check carefully C++ member alignments. --- ports/geckolib/gecko_style_structs.rs | 39 ++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/ports/geckolib/gecko_style_structs.rs b/ports/geckolib/gecko_style_structs.rs index d47f185d12e..723620fce3f 100644 --- a/ports/geckolib/gecko_style_structs.rs +++ b/ports/geckolib/gecko_style_structs.rs @@ -1795,7 +1795,16 @@ pub type nsIID = nsID; */ #[repr(C)] #[derive(Copy, Clone)] -pub struct nsISupports; +pub struct nsISupports { + pub _vftable: *const _vftable_nsISupports, +} +#[repr(C)] +pub struct _vftable_nsISupports { +} +#[test] +fn bindgen_test_layout_nsISupports() { + assert_eq!(:: std:: mem:: size_of:: < nsISupports > ( ) , 8usize); +} #[repr(C)] #[derive(Copy, Clone)] pub struct nsAutoOwningThread { @@ -2493,6 +2502,10 @@ pub type nsLoadFlags = u32; pub struct nsIRequest { pub _base: nsISupports, } +#[repr(C)] +pub struct _vftable_nsIRequest { + pub _base: _vftable_nsISupports, +} #[repr(u32)] #[derive(Copy, Clone, Debug)] pub enum nsIRequest_nsIRequest_h_unnamed_6 { @@ -2526,6 +2539,10 @@ fn bindgen_test_layout_nsIPrincipal() { pub struct nsIExpandedPrincipal { pub _base: nsISupports, } +#[repr(C)] +pub struct _vftable_nsIExpandedPrincipal { + pub _base: _vftable_nsISupports, +} /** * This structure precedes the string buffers "we" allocate. It may be the * case that nsTAString::mData does not point to one of these special @@ -2557,6 +2574,10 @@ pub struct nsIAtom { */ pub mString: *mut ::std::os::raw::c_ushort, } +#[repr(C)] +pub struct _vftable_nsIAtom { + pub _base: _vftable_nsISupports, +} #[test] fn bindgen_test_layout_nsIAtom() { assert_eq!(:: std:: mem:: size_of:: < nsIAtom > ( ) , 24usize); @@ -2629,6 +2650,10 @@ pub struct ArenaRefPtr { pub struct nsIURI { pub _base: nsISupports, } +#[repr(C)] +pub struct _vftable_nsIURI { + pub _base: _vftable_nsISupports, +} pub const eCSSProperty_COUNT_DUMMY: nsCSSProperty = nsCSSProperty::eCSSProperty__x_text_zoom; pub const eCSSProperty__moz_outline_radius: nsCSSProperty = @@ -3509,8 +3534,12 @@ pub enum PadType { } #[repr(C)] #[derive(Copy, Clone)] pub struct CounterStyle { + pub _vftable: *const _vftable_CounterStyle, pub mStyle: i32, } +#[repr(C)] +pub struct _vftable_CounterStyle { +} #[test] fn bindgen_test_layout_CounterStyle() { assert_eq!(:: std:: mem:: size_of:: < CounterStyle > ( ) , 16usize); @@ -3524,6 +3553,10 @@ pub struct AnonymousCounterStyle { pub mSystem: u8, pub mSymbols: [u8; 8usize], } +#[repr(C)] +pub struct _vftable_AnonymousCounterStyle { + pub _base: _vftable_CounterStyle, +} #[test] fn bindgen_test_layout_AnonymousCounterStyle() { assert_eq!(:: std:: mem:: size_of:: < AnonymousCounterStyle > ( ) , @@ -3614,6 +3647,7 @@ pub enum nsStyleImageType { pub struct nsStyleImage { pub mSubImages: [u8; 8usize], pub mType: nsStyleImageType, + pub nsStyleStruct_h_unnamed_11: nsStyleImage_nsStyleStruct_h_unnamed_11, pub mCropRect: nsAutoPtr, pub mImageTracked: bool, } @@ -4032,6 +4066,7 @@ fn bindgen_test_layout_nsStyleVisibility() { #[derive(Copy, Clone)] pub struct nsTimingFunction { pub mType: nsTimingFunction_Type, + pub nsStyleStruct_h_unnamed_13: nsTimingFunction_nsStyleStruct_h_unnamed_13, } #[repr(i32)] #[derive(Copy, Clone, Debug)] @@ -4399,6 +4434,7 @@ fn bindgen_test_layout_nsStyleBasicShape() { #[repr(C)] pub struct nsStyleClipPath { pub mType: i32, + pub nsStyleStruct_h_unnamed_18: nsStyleClipPath_nsStyleStruct_h_unnamed_18, pub mSizingBox: u8, } #[repr(C)] @@ -4415,6 +4451,7 @@ fn bindgen_test_layout_nsStyleClipPath() { pub struct nsStyleFilter { pub mType: i32, pub mFilterParameter: nsStyleCoord, + pub nsStyleStruct_h_unnamed_19: nsStyleFilter_nsStyleStruct_h_unnamed_19, } #[repr(C)] #[derive(Copy, Clone, Debug)]