aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/parallel.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <me@emiliocobos.me>2016-04-08 21:39:28 +0200
committerEmilio Cobos Álvarez <me@emiliocobos.me>2016-04-08 21:49:13 +0200
commitc906d06d4e99ecb7ac0cf25367c506db697ccb2e (patch)
tree5ef2c271e0064ef0810a41df447b0ddcfce61540 /components/layout/parallel.rs
parent217e45006bc04a932650cbfda52388ce1d2a5698 (diff)
downloadservo-c906d06d4e99ecb7ac0cf25367c506db697ccb2e.tar.gz
servo-c906d06d4e99ecb7ac0cf25367c506db697ccb2e.zip
geckolib: reupdate bindings to allow easy union modifications
This commit updates the current bindings with a m-c trunk build. This improves quite a few things: * It adds `Debug` support for structs, which should be easy. * It generates unnamed structs definitions. * And... It allows changing union types directly! The way mutating a union works is as follows. Each union field has an unsized field of type `__BindgenUnionField<T>`, where `T` is the type of the field. The field has two unsafe methods, `as_ref` and `as_mut`, that would work as follows (assuming 64 bit pointers): ```` let u = nsStyleUnion { mInt: Default::default(), mFloat: Default::default(), mPointer: Default::default(), _bindgen_data_: 0, }; unsafe { assert_eq!(*u.mInt.as_ref() == 0); *u.mPointer.as_mut() = !0 as *mut _; assert_eq!(*u.mInt.as_ref() == !0); *u.mInt.as_mut() = 0; assert_eq!(*u.mInt.as_ref() == 0); assert_eq!(*u.mPointer.as_ref() == (!0 << 32) as *mut _); } ```
Diffstat (limited to 'components/layout/parallel.rs')
0 files changed, 0 insertions, 0 deletions