Skip to content

Commit

Permalink
style: Fix nsStyleBorder::mBorderColor for GCC.
Browse files Browse the repository at this point in the history
GCC doesn't like StyleComplexColor with constructor in an anonymous
struct in an anonymous union.  Replace the use of a union to access
`mBorder[..]Color` fields as an array with an accessor methods.

Bug: 1465307
Reviewed-by: xidorn
MozReview-Commit-ID: 1Wulh1qKYCZ
  • Loading branch information
djg authored and emilio committed Jun 12, 2018
1 parent cdbc409 commit 314b14d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -388,17 +388,9 @@ impl ${style_struct.gecko_struct_name} {

<%!
def get_gecko_property(ffi_name, self_param = "self"):
if "mBorderColor" in ffi_name:
return ffi_name.replace("mBorderColor",
"unsafe { *%s.gecko.__bindgen_anon_1.mBorderColor.as_ref() }"
% self_param)
return "%s.gecko.%s" % (self_param, ffi_name)

def set_gecko_property(ffi_name, expr):
if "mBorderColor" in ffi_name:
ffi_name = ffi_name.replace("mBorderColor",
"*self.gecko.__bindgen_anon_1.mBorderColor.as_mut()")
return "unsafe { %s = %s };" % (ffi_name, expr)
return "self.gecko.%s = %s;" % (ffi_name, expr)
%>

Expand Down Expand Up @@ -1594,7 +1586,7 @@ fn static_assert() {
self.gecko.mComputedBorder.${side.ident} = self.gecko.mBorder.${side.ident};
}

<% impl_color("border_%s_color" % side.ident, "(mBorderColor)[%s]" % side.index) %>
<% impl_color("border_%s_color" % side.ident, "mBorder%sColor" % side.name) %>

<% impl_non_negative_length("border_%s_width" % side.ident,
"mComputedBorder.%s" % side.ident,
Expand Down

0 comments on commit 314b14d

Please sign in to comment.