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.
This commit is contained in:
Emilio Cobos Álvarez 2016-03-25 18:03:12 +01:00
parent c220fcdb00
commit 6c851c88ea

View file

@ -1795,7 +1795,16 @@ pub type nsIID = nsID;
*/ */
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[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)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct nsAutoOwningThread { pub struct nsAutoOwningThread {
@ -2493,6 +2502,10 @@ pub type nsLoadFlags = u32;
pub struct nsIRequest { pub struct nsIRequest {
pub _base: nsISupports, pub _base: nsISupports,
} }
#[repr(C)]
pub struct _vftable_nsIRequest {
pub _base: _vftable_nsISupports,
}
#[repr(u32)] #[repr(u32)]
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
pub enum nsIRequest_nsIRequest_h_unnamed_6 { pub enum nsIRequest_nsIRequest_h_unnamed_6 {
@ -2526,6 +2539,10 @@ fn bindgen_test_layout_nsIPrincipal() {
pub struct nsIExpandedPrincipal { pub struct nsIExpandedPrincipal {
pub _base: nsISupports, 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 * This structure precedes the string buffers "we" allocate. It may be the
* case that nsTAString::mData does not point to one of these special * 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, pub mString: *mut ::std::os::raw::c_ushort,
} }
#[repr(C)]
pub struct _vftable_nsIAtom {
pub _base: _vftable_nsISupports,
}
#[test] #[test]
fn bindgen_test_layout_nsIAtom() { fn bindgen_test_layout_nsIAtom() {
assert_eq!(:: std:: mem:: size_of:: < nsIAtom > ( ) , 24usize); assert_eq!(:: std:: mem:: size_of:: < nsIAtom > ( ) , 24usize);
@ -2629,6 +2650,10 @@ pub struct ArenaRefPtr<T> {
pub struct nsIURI { pub struct nsIURI {
pub _base: nsISupports, pub _base: nsISupports,
} }
#[repr(C)]
pub struct _vftable_nsIURI {
pub _base: _vftable_nsISupports,
}
pub const eCSSProperty_COUNT_DUMMY: nsCSSProperty = pub const eCSSProperty_COUNT_DUMMY: nsCSSProperty =
nsCSSProperty::eCSSProperty__x_text_zoom; nsCSSProperty::eCSSProperty__x_text_zoom;
pub const eCSSProperty__moz_outline_radius: nsCSSProperty = pub const eCSSProperty__moz_outline_radius: nsCSSProperty =
@ -3509,8 +3534,12 @@ pub enum PadType { }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct CounterStyle { pub struct CounterStyle {
pub _vftable: *const _vftable_CounterStyle,
pub mStyle: i32, pub mStyle: i32,
} }
#[repr(C)]
pub struct _vftable_CounterStyle {
}
#[test] #[test]
fn bindgen_test_layout_CounterStyle() { fn bindgen_test_layout_CounterStyle() {
assert_eq!(:: std:: mem:: size_of:: < CounterStyle > ( ) , 16usize); assert_eq!(:: std:: mem:: size_of:: < CounterStyle > ( ) , 16usize);
@ -3524,6 +3553,10 @@ pub struct AnonymousCounterStyle {
pub mSystem: u8, pub mSystem: u8,
pub mSymbols: [u8; 8usize], pub mSymbols: [u8; 8usize],
} }
#[repr(C)]
pub struct _vftable_AnonymousCounterStyle {
pub _base: _vftable_CounterStyle,
}
#[test] #[test]
fn bindgen_test_layout_AnonymousCounterStyle() { fn bindgen_test_layout_AnonymousCounterStyle() {
assert_eq!(:: std:: mem:: size_of:: < AnonymousCounterStyle > ( ) , assert_eq!(:: std:: mem:: size_of:: < AnonymousCounterStyle > ( ) ,
@ -3614,6 +3647,7 @@ pub enum nsStyleImageType {
pub struct nsStyleImage { pub struct nsStyleImage {
pub mSubImages: [u8; 8usize], pub mSubImages: [u8; 8usize],
pub mType: nsStyleImageType, pub mType: nsStyleImageType,
pub nsStyleStruct_h_unnamed_11: nsStyleImage_nsStyleStruct_h_unnamed_11,
pub mCropRect: nsAutoPtr<nsStyleSides>, pub mCropRect: nsAutoPtr<nsStyleSides>,
pub mImageTracked: bool, pub mImageTracked: bool,
} }
@ -4032,6 +4066,7 @@ fn bindgen_test_layout_nsStyleVisibility() {
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct nsTimingFunction { pub struct nsTimingFunction {
pub mType: nsTimingFunction_Type, pub mType: nsTimingFunction_Type,
pub nsStyleStruct_h_unnamed_13: nsTimingFunction_nsStyleStruct_h_unnamed_13,
} }
#[repr(i32)] #[repr(i32)]
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
@ -4399,6 +4434,7 @@ fn bindgen_test_layout_nsStyleBasicShape() {
#[repr(C)] #[repr(C)]
pub struct nsStyleClipPath { pub struct nsStyleClipPath {
pub mType: i32, pub mType: i32,
pub nsStyleStruct_h_unnamed_18: nsStyleClipPath_nsStyleStruct_h_unnamed_18,
pub mSizingBox: u8, pub mSizingBox: u8,
} }
#[repr(C)] #[repr(C)]
@ -4415,6 +4451,7 @@ fn bindgen_test_layout_nsStyleClipPath() {
pub struct nsStyleFilter { pub struct nsStyleFilter {
pub mType: i32, pub mType: i32,
pub mFilterParameter: nsStyleCoord, pub mFilterParameter: nsStyleCoord,
pub nsStyleStruct_h_unnamed_19: nsStyleFilter_nsStyleStruct_h_unnamed_19,
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]