From fcbfb4fbd224b24bcfd3614c21dee32edca5a70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 2 Apr 2016 21:18:20 +0200 Subject: [PATCH 1/3] geckolib: Define JS_DEBUG to fix generation, and fix escape --- ports/geckolib/tools/regen_style_structs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/geckolib/tools/regen_style_structs.sh b/ports/geckolib/tools/regen_style_structs.sh index 8470a305c79..d4f3b822415 100755 --- a/ports/geckolib/tools/regen_style_structs.sh +++ b/ports/geckolib/tools/regen_style_structs.sh @@ -65,6 +65,7 @@ fi -no-type-renaming \ -DMOZILLA_INTERNAL_API \ -DMOZ_STYLO_BINDINGS=1 \ + -DJS_DEBUG=1 \ -DDEBUG=1 -DTRACING=1 -DOS_POSIX=1 \ -DIMPL_LIBXUL \ -match "RefCountType.h" \ @@ -130,7 +131,7 @@ fi "$DIST_INCLUDE/nsStyleStruct.h" if [ $? -ne 0 ]; then - echo -e "\e[91warning:\e[0m bindgen exited with nonzero exit status" + echo -e "\e[91mwarning:\e[0m bindgen exited with nonzero exit status" else echo -e "\e[34minfo:\e[0m bindgen exited successfully, running tests" TESTS_FILE=$(mktemp) From fd79e7a20fedb5362ea71f46cbe41ea43ba1413c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 2 Apr 2016 21:44:13 +0200 Subject: [PATCH 2/3] geckolib: Add correct repr() for enum declarations This fixes the layout of `StyleAnimation`, though we probably want to include AnimationEffectReadOnlyBinding.h. The problem with that is that namespacing should be polished, or a lot of types should be blacklisted, since the bindings define a few repetitive names. --- ports/geckolib/gecko_style_structs.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/geckolib/gecko_style_structs.rs b/ports/geckolib/gecko_style_structs.rs index ac0b6393a85..61de5756be9 100644 --- a/ports/geckolib/gecko_style_structs.rs +++ b/ports/geckolib/gecko_style_structs.rs @@ -2541,8 +2541,12 @@ fn bindgen_test_layout_nsRect() { #[repr(i8)] #[derive(Debug, Copy, Clone)] pub enum StyleBoxSizing { Content = 0, Padding = 1, Border = 2, } -pub enum PlaybackDirection { } -pub enum FillMode { } +#[repr(i32)] +#[derive(Debug, Copy, Clone)] +pub enum PlaybackDirection { _BindgenOpaqueEnum = 0, } +#[repr(i32)] +#[derive(Debug, Copy, Clone)] +pub enum FillMode { _BindgenOpaqueEnum = 0, } pub enum WritingMode { } #[repr(u32)] #[derive(Debug, Copy, Clone)] From 13e87b4479e5dc228876d45a50f75444a6b34493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 3 Apr 2016 00:41:11 +0200 Subject: [PATCH 3/3] geckolib: Correctly generate bitfields --- ports/geckolib/gecko_style_structs.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/geckolib/gecko_style_structs.rs b/ports/geckolib/gecko_style_structs.rs index 61de5756be9..4e94c216d1b 100644 --- a/ports/geckolib/gecko_style_structs.rs +++ b/ports/geckolib/gecko_style_structs.rs @@ -4672,9 +4672,8 @@ pub struct nsStyleSVG { pub mStrokeLinejoin: u8, pub mTextAnchor: u8, pub mTextRendering: u8, - pub _bitfield_1: nsStyleSVGOpacitySource, - pub _bitfield_2: nsStyleSVGOpacitySource, - pub _bitfield_3: u8, + pub _bitfield_1: u8, + pub _bitfield_2: u8, } #[test] fn bindgen_test_layout_nsStyleSVG() {