Auto merge of #10865 - bholley:simplify_bindgen, r=emilio

Remove the need for custom clang to generate stylo bindings, plus misc other fixes

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10865)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-26 19:51:13 -07:00
commit 77553ab42c
9 changed files with 433 additions and 446 deletions

View file

@ -25,7 +25,6 @@ use gecko_style_structs::nsStyleSVGReset;
use gecko_style_structs::nsStyleColumn;
use gecko_style_structs::nsStyleEffects;
pub enum nsIAtom { }
pub enum nsINode { }
pub type RawGeckoNode = nsINode;
@ -86,7 +85,8 @@ extern "C" {
-> *mut ServoComputedValues;
pub fn Servo_GetComputedValuesForAnonymousBox(parentStyleOrNull:
*mut ServoComputedValues,
pseudoTag: *mut nsIAtom)
pseudoTag: *mut nsIAtom,
set: *mut RawServoStyleSet)
-> *mut ServoComputedValues;
pub fn Servo_AddRefComputedValues(arg1: *mut ServoComputedValues);
pub fn Servo_ReleaseComputedValues(arg1: *mut ServoComputedValues);

View file

@ -648,7 +648,7 @@ pub const NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_UNICODE_BIDI_NORMAL: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_UNICODE_BIDI_EMBED: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_UNICODE_BIDI_ISOLATE: ::std::os::raw::c_uint = 2;
pub const NS_STYLE_UNICODE_BIDI_OVERRIDE: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_UNICODE_BIDI_BIDI_OVERRIDE: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_UNICODE_BIDI_ISOLATE_OVERRIDE: ::std::os::raw::c_uint = 6;
pub const NS_STYLE_UNICODE_BIDI_PLAINTEXT: ::std::os::raw::c_uint = 8;
pub const NS_STYLE_TABLE_LAYOUT_AUTO: ::std::os::raw::c_uint = 0;
@ -836,7 +836,9 @@ pub const NS_STYLE_INELIGIBLE_FOR_SHARING: ::std::os::raw::c_ulonglong =
pub const NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE:
::std::os::raw::c_ulonglong =
17179869184;
pub const NS_STYLE_CONTEXT_TYPE_SHIFT: ::std::os::raw::c_uint = 35;
pub const NS_STYLE_IS_TEXT_COMBINED: ::std::os::raw::c_ulonglong =
34359738368;
pub const NS_STYLE_CONTEXT_TYPE_SHIFT: ::std::os::raw::c_uint = 36;
pub const NS_RULE_NODE_IS_ANIMATION_RULE: ::std::os::raw::c_uint = 16777216;
pub const NS_RULE_NODE_USED_DIRECTLY: ::std::os::raw::c_uint = 67108864;
pub const NS_RULE_NODE_IS_IMPORTANT: ::std::os::raw::c_uint = 134217728;
@ -934,6 +936,7 @@ pub enum nsresult {
NS_ERROR_GFX_PRINTER_DOC_IS_BUSY = -2142765049,
NS_ERROR_GFX_CMAP_MALFORMED = -2142765005,
NS_SUCCESS_EVENT_CONSUMED = 4784129,
NS_SUCCESS_EVENT_HANDLED_ASYNCHRONOUSLY = 4784130,
NS_BINDING_FAILED = -2142568447,
NS_BINDING_ABORTED = -2142568446,
NS_BINDING_REDIRECTED = -2142568445,
@ -957,6 +960,7 @@ pub enum nsresult {
NS_ERROR_NET_INTERRUPT = -2142568377,
NS_ERROR_PROXY_CONNECTION_REFUSED = -2142568376,
NS_ERROR_NET_PARTIAL_TRANSFER = -2142568372,
NS_ERROR_NET_INADEQUATE_SECURITY = -2142568366,
NS_ERROR_NOT_RESUMABLE = -2142568423,
NS_ERROR_REDIRECT_LOOP = -2142568417,
NS_ERROR_ENTITY_CHANGED = -2142568416,
@ -1319,10 +1323,14 @@ pub enum nsresult {
NS_ERROR_SIGNED_APP_MANIFEST_INVALID = -2140471295,
NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR = -2140405759,
NS_ERROR_DOM_ANIM_NO_TARGET_ERR = -2140405758,
NS_ERROR_DOM_ANIM_NO_TIMELINE_ERR = -2140405757,
NS_ERROR_DOM_ANIM_NO_EFFECT_ERR = -2140405756,
NS_ERROR_DOM_PUSH_INVALID_REGISTRATION_ERR = -2140340223,
NS_ERROR_DOM_PUSH_DENIED_ERR = -2140340222,
NS_ERROR_DOM_PUSH_ABORT_ERR = -2140340221,
NS_ERROR_DOM_PUSH_SERVICE_UNREACHABLE = -2140340220,
NS_ERROR_DOM_PUSH_INVALID_KEY_ERR = -2140340219,
NS_ERROR_DOM_PUSH_MISMATCHED_KEY_ERR = -2140340218,
NS_ERROR_DOWNLOAD_COMPLETE = -2139619327,
NS_ERROR_DOWNLOAD_NOT_PARTIAL = -2139619326,
NS_ERROR_UNORM_MOREOUTPUT = -2139619295,
@ -2941,6 +2949,7 @@ pub struct nsFont {
pub variantCaps: u8,
pub variantNumeric: u8,
pub variantPosition: u8,
pub variantWidth: u8,
pub variantLigatures: u16,
pub variantEastAsian: u16,
pub variantAlternates: u16,
@ -3091,358 +3100,363 @@ pub enum nsCSSProperty {
eCSSProperty_box_flex = 67,
eCSSProperty_box_ordinal_group = 68,
eCSSProperty_box_orient = 69,
eCSSProperty_webkit_box_orient = 70,
eCSSProperty_box_pack = 71,
eCSSProperty_box_shadow = 72,
eCSSProperty_box_sizing = 73,
eCSSProperty_caption_side = 74,
eCSSProperty_clear = 75,
eCSSProperty_clip = 76,
eCSSProperty_clip_path = 77,
eCSSProperty_clip_rule = 78,
eCSSProperty_color = 79,
eCSSProperty_color_adjust = 80,
eCSSProperty_color_interpolation = 81,
eCSSProperty_color_interpolation_filters = 82,
eCSSProperty__moz_column_count = 83,
eCSSProperty__moz_column_fill = 84,
eCSSProperty__moz_column_gap = 85,
eCSSProperty__moz_column_rule_color = 86,
eCSSProperty__moz_column_rule_style = 87,
eCSSProperty__moz_column_rule_width = 88,
eCSSProperty__moz_column_width = 89,
eCSSProperty_contain = 90,
eCSSProperty_content = 91,
eCSSProperty__moz_control_character_visibility = 92,
eCSSProperty_counter_increment = 93,
eCSSProperty_counter_reset = 94,
eCSSProperty_cursor = 95,
eCSSProperty_direction = 96,
eCSSProperty_display = 97,
eCSSProperty_dominant_baseline = 98,
eCSSProperty_empty_cells = 99,
eCSSProperty_fill = 100,
eCSSProperty_fill_opacity = 101,
eCSSProperty_fill_rule = 102,
eCSSProperty_filter = 103,
eCSSProperty_flex_basis = 104,
eCSSProperty_flex_direction = 105,
eCSSProperty_flex_grow = 106,
eCSSProperty_flex_shrink = 107,
eCSSProperty_flex_wrap = 108,
eCSSProperty_float = 109,
eCSSProperty_float_edge = 110,
eCSSProperty_flood_color = 111,
eCSSProperty_flood_opacity = 112,
eCSSProperty_font_family = 113,
eCSSProperty_font_feature_settings = 114,
eCSSProperty_font_kerning = 115,
eCSSProperty_font_language_override = 116,
eCSSProperty_font_size = 117,
eCSSProperty_font_size_adjust = 118,
eCSSProperty_font_stretch = 119,
eCSSProperty_font_style = 120,
eCSSProperty_font_synthesis = 121,
eCSSProperty_font_variant_alternates = 122,
eCSSProperty_font_variant_caps = 123,
eCSSProperty_font_variant_east_asian = 124,
eCSSProperty_font_variant_ligatures = 125,
eCSSProperty_font_variant_numeric = 126,
eCSSProperty_font_variant_position = 127,
eCSSProperty_font_weight = 128,
eCSSProperty_force_broken_image_icon = 129,
eCSSProperty_grid_auto_columns = 130,
eCSSProperty_grid_auto_flow = 131,
eCSSProperty_grid_auto_rows = 132,
eCSSProperty_grid_column_end = 133,
eCSSProperty_grid_column_gap = 134,
eCSSProperty_grid_column_start = 135,
eCSSProperty_grid_row_end = 136,
eCSSProperty_grid_row_gap = 137,
eCSSProperty_grid_row_start = 138,
eCSSProperty_grid_template_areas = 139,
eCSSProperty_grid_template_columns = 140,
eCSSProperty_grid_template_rows = 141,
eCSSProperty_height = 142,
eCSSProperty_hyphens = 143,
eCSSProperty_image_orientation = 144,
eCSSProperty_image_region = 145,
eCSSProperty_image_rendering = 146,
eCSSProperty_ime_mode = 147,
eCSSProperty_inline_size = 148,
eCSSProperty_isolation = 149,
eCSSProperty_justify_content = 150,
eCSSProperty_justify_items = 151,
eCSSProperty_justify_self = 152,
eCSSProperty__x_lang = 153,
eCSSProperty_left = 154,
eCSSProperty_letter_spacing = 155,
eCSSProperty_lighting_color = 156,
eCSSProperty_line_height = 157,
eCSSProperty_list_style_image = 158,
eCSSProperty_list_style_position = 159,
eCSSProperty_list_style_type = 160,
eCSSProperty_margin_block_end = 161,
eCSSProperty_margin_block_start = 162,
eCSSProperty_margin_bottom = 163,
eCSSProperty_margin_inline_end = 164,
eCSSProperty_margin_inline_start = 165,
eCSSProperty_margin_left = 166,
eCSSProperty_margin_right = 167,
eCSSProperty_margin_top = 168,
eCSSProperty_marker_end = 169,
eCSSProperty_marker_mid = 170,
eCSSProperty_marker_offset = 171,
eCSSProperty_marker_start = 172,
eCSSProperty_mask = 173,
eCSSProperty_mask_type = 174,
eCSSProperty_math_display = 175,
eCSSProperty_math_variant = 176,
eCSSProperty_max_block_size = 177,
eCSSProperty_max_height = 178,
eCSSProperty_max_inline_size = 179,
eCSSProperty_max_width = 180,
eCSSProperty_min_block_size = 181,
eCSSProperty__moz_min_font_size_ratio = 182,
eCSSProperty_min_height = 183,
eCSSProperty_min_inline_size = 184,
eCSSProperty_min_width = 185,
eCSSProperty_mix_blend_mode = 186,
eCSSProperty_object_fit = 187,
eCSSProperty_object_position = 188,
eCSSProperty_offset_block_end = 189,
eCSSProperty_offset_block_start = 190,
eCSSProperty_offset_inline_end = 191,
eCSSProperty_offset_inline_start = 192,
eCSSProperty_opacity = 193,
eCSSProperty_order = 194,
eCSSProperty_orient = 195,
eCSSProperty_osx_font_smoothing = 196,
eCSSProperty_outline_color = 197,
eCSSProperty_outline_offset = 198,
eCSSProperty__moz_outline_radius_bottomLeft = 199,
eCSSProperty__moz_outline_radius_bottomRight = 200,
eCSSProperty__moz_outline_radius_topLeft = 201,
eCSSProperty__moz_outline_radius_topRight = 202,
eCSSProperty_outline_style = 203,
eCSSProperty_outline_width = 204,
eCSSProperty_overflow_clip_box = 205,
eCSSProperty_overflow_x = 206,
eCSSProperty_overflow_y = 207,
eCSSProperty_padding_block_end = 208,
eCSSProperty_padding_block_start = 209,
eCSSProperty_padding_bottom = 210,
eCSSProperty_padding_inline_end = 211,
eCSSProperty_padding_inline_start = 212,
eCSSProperty_padding_left = 213,
eCSSProperty_padding_right = 214,
eCSSProperty_padding_top = 215,
eCSSProperty_page_break_after = 216,
eCSSProperty_page_break_before = 217,
eCSSProperty_page_break_inside = 218,
eCSSProperty_paint_order = 219,
eCSSProperty_perspective = 220,
eCSSProperty_perspective_origin = 221,
eCSSProperty_pointer_events = 222,
eCSSProperty_position = 223,
eCSSProperty_quotes = 224,
eCSSProperty_resize = 225,
eCSSProperty_right = 226,
eCSSProperty_ruby_align = 227,
eCSSProperty_ruby_position = 228,
eCSSProperty_script_level = 229,
eCSSProperty_script_min_size = 230,
eCSSProperty_script_size_multiplier = 231,
eCSSProperty_scroll_behavior = 232,
eCSSProperty_scroll_snap_coordinate = 233,
eCSSProperty_scroll_snap_destination = 234,
eCSSProperty_scroll_snap_points_x = 235,
eCSSProperty_scroll_snap_points_y = 236,
eCSSProperty_scroll_snap_type_x = 237,
eCSSProperty_scroll_snap_type_y = 238,
eCSSProperty_shape_rendering = 239,
eCSSProperty__x_span = 240,
eCSSProperty_stack_sizing = 241,
eCSSProperty_stop_color = 242,
eCSSProperty_stop_opacity = 243,
eCSSProperty_stroke = 244,
eCSSProperty_stroke_dasharray = 245,
eCSSProperty_stroke_dashoffset = 246,
eCSSProperty_stroke_linecap = 247,
eCSSProperty_stroke_linejoin = 248,
eCSSProperty_stroke_miterlimit = 249,
eCSSProperty_stroke_opacity = 250,
eCSSProperty_stroke_width = 251,
eCSSProperty__x_system_font = 252,
eCSSProperty__moz_tab_size = 253,
eCSSProperty_table_layout = 254,
eCSSProperty_text_align = 255,
eCSSProperty_text_align_last = 256,
eCSSProperty_text_anchor = 257,
eCSSProperty_text_combine_upright = 258,
eCSSProperty_text_decoration_color = 259,
eCSSProperty_text_decoration_line = 260,
eCSSProperty_text_decoration_style = 261,
eCSSProperty_text_emphasis_color = 262,
eCSSProperty_text_emphasis_position = 263,
eCSSProperty_text_emphasis_style = 264,
eCSSProperty__webkit_text_fill_color = 265,
eCSSProperty_text_indent = 266,
eCSSProperty_text_orientation = 267,
eCSSProperty_text_overflow = 268,
eCSSProperty_text_rendering = 269,
eCSSProperty_text_shadow = 270,
eCSSProperty_text_size_adjust = 271,
eCSSProperty_text_transform = 272,
eCSSProperty__x_text_zoom = 273,
eCSSProperty_top = 274,
eCSSProperty__moz_top_layer = 275,
eCSSProperty_touch_action = 276,
eCSSProperty_transform = 277,
eCSSProperty_transform_box = 278,
eCSSProperty_transform_origin = 279,
eCSSProperty_transform_style = 280,
eCSSProperty_transition_delay = 281,
eCSSProperty_transition_duration = 282,
eCSSProperty_transition_property = 283,
eCSSProperty_transition_timing_function = 284,
eCSSProperty_unicode_bidi = 285,
eCSSProperty_user_focus = 286,
eCSSProperty_user_input = 287,
eCSSProperty_user_modify = 288,
eCSSProperty_user_select = 289,
eCSSProperty_vector_effect = 290,
eCSSProperty_vertical_align = 291,
eCSSProperty_visibility = 292,
eCSSProperty_white_space = 293,
eCSSProperty_width = 294,
eCSSProperty_will_change = 295,
eCSSProperty__moz_window_dragging = 296,
eCSSProperty__moz_window_shadow = 297,
eCSSProperty_word_break = 298,
eCSSProperty_word_spacing = 299,
eCSSProperty_word_wrap = 300,
eCSSProperty_writing_mode = 301,
eCSSProperty_z_index = 302,
eCSSProperty_COUNT_no_shorthands = 303,
eCSSProperty_animation = 304,
eCSSProperty_background = 305,
eCSSProperty_border = 306,
eCSSProperty_border_block_end = 307,
eCSSProperty_border_block_start = 308,
eCSSProperty_border_bottom = 309,
eCSSProperty_border_color = 310,
eCSSProperty_border_image = 311,
eCSSProperty_border_inline_end = 312,
eCSSProperty_border_inline_start = 313,
eCSSProperty_border_left = 314,
eCSSProperty_border_radius = 315,
eCSSProperty_border_right = 316,
eCSSProperty_border_style = 317,
eCSSProperty_border_top = 318,
eCSSProperty_border_width = 319,
eCSSProperty__moz_column_rule = 320,
eCSSProperty__moz_columns = 321,
eCSSProperty_flex = 322,
eCSSProperty_flex_flow = 323,
eCSSProperty_font = 324,
eCSSProperty_font_variant = 325,
eCSSProperty_grid = 326,
eCSSProperty_grid_area = 327,
eCSSProperty_grid_column = 328,
eCSSProperty_grid_gap = 329,
eCSSProperty_grid_row = 330,
eCSSProperty_list_style = 331,
eCSSProperty_margin = 332,
eCSSProperty_marker = 333,
eCSSProperty_outline = 334,
eCSSProperty__moz_outline_radius = 335,
eCSSProperty_overflow = 336,
eCSSProperty_padding = 337,
eCSSProperty_scroll_snap_type = 338,
eCSSProperty_text_decoration = 339,
eCSSProperty_text_emphasis = 340,
eCSSProperty__moz_transform = 341,
eCSSProperty_transition = 342,
eCSSProperty_COUNT = 343,
eCSSPropertyAlias_MozPerspectiveOrigin = 344,
eCSSPropertyAlias_MozPerspective = 345,
eCSSPropertyAlias_MozTransformStyle = 346,
eCSSPropertyAlias_MozBackfaceVisibility = 347,
eCSSPropertyAlias_MozBorderImage = 348,
eCSSPropertyAlias_MozTransition = 349,
eCSSPropertyAlias_MozTransitionDelay = 350,
eCSSPropertyAlias_MozTransitionDuration = 351,
eCSSPropertyAlias_MozTransitionProperty = 352,
eCSSPropertyAlias_MozTransitionTimingFunction = 353,
eCSSPropertyAlias_MozAnimation = 354,
eCSSPropertyAlias_MozAnimationDelay = 355,
eCSSPropertyAlias_MozAnimationDirection = 356,
eCSSPropertyAlias_MozAnimationDuration = 357,
eCSSPropertyAlias_MozAnimationFillMode = 358,
eCSSPropertyAlias_MozAnimationIterationCount = 359,
eCSSPropertyAlias_MozAnimationName = 360,
eCSSPropertyAlias_MozAnimationPlayState = 361,
eCSSPropertyAlias_MozAnimationTimingFunction = 362,
eCSSPropertyAlias_MozBoxSizing = 363,
eCSSPropertyAlias_MozFontFeatureSettings = 364,
eCSSPropertyAlias_MozFontLanguageOverride = 365,
eCSSPropertyAlias_MozPaddingEnd = 366,
eCSSPropertyAlias_MozPaddingStart = 367,
eCSSPropertyAlias_MozMarginEnd = 368,
eCSSPropertyAlias_MozMarginStart = 369,
eCSSPropertyAlias_MozBorderEnd = 370,
eCSSPropertyAlias_MozBorderEndColor = 371,
eCSSPropertyAlias_MozBorderEndStyle = 372,
eCSSPropertyAlias_MozBorderEndWidth = 373,
eCSSPropertyAlias_MozBorderStart = 374,
eCSSPropertyAlias_MozBorderStartColor = 375,
eCSSPropertyAlias_MozBorderStartStyle = 376,
eCSSPropertyAlias_MozBorderStartWidth = 377,
eCSSPropertyAlias_MozHyphens = 378,
eCSSPropertyAlias_WebkitAnimation = 379,
eCSSPropertyAlias_WebkitAnimationDelay = 380,
eCSSPropertyAlias_WebkitAnimationDirection = 381,
eCSSPropertyAlias_WebkitAnimationDuration = 382,
eCSSPropertyAlias_WebkitAnimationFillMode = 383,
eCSSPropertyAlias_WebkitAnimationIterationCount = 384,
eCSSPropertyAlias_WebkitAnimationName = 385,
eCSSPropertyAlias_WebkitAnimationPlayState = 386,
eCSSPropertyAlias_WebkitAnimationTimingFunction = 387,
eCSSPropertyAlias_WebkitFilter = 388,
eCSSPropertyAlias_WebkitTextSizeAdjust = 389,
eCSSPropertyAlias_WebkitTransform = 390,
eCSSPropertyAlias_WebkitTransformOrigin = 391,
eCSSPropertyAlias_WebkitTransformStyle = 392,
eCSSPropertyAlias_WebkitBackfaceVisibility = 393,
eCSSPropertyAlias_WebkitPerspective = 394,
eCSSPropertyAlias_WebkitPerspectiveOrigin = 395,
eCSSPropertyAlias_WebkitTransition = 396,
eCSSPropertyAlias_WebkitTransitionDelay = 397,
eCSSPropertyAlias_WebkitTransitionDuration = 398,
eCSSPropertyAlias_WebkitTransitionProperty = 399,
eCSSPropertyAlias_WebkitTransitionTimingFunction = 400,
eCSSPropertyAlias_WebkitBorderRadius = 401,
eCSSPropertyAlias_WebkitBorderTopLeftRadius = 402,
eCSSPropertyAlias_WebkitBorderTopRightRadius = 403,
eCSSPropertyAlias_WebkitBorderBottomLeftRadius = 404,
eCSSPropertyAlias_WebkitBorderBottomRightRadius = 405,
eCSSPropertyAlias_WebkitBackgroundClip = 406,
eCSSPropertyAlias_WebkitBackgroundOrigin = 407,
eCSSPropertyAlias_WebkitBackgroundSize = 408,
eCSSPropertyAlias_WebkitBorderImage = 409,
eCSSPropertyAlias_WebkitBoxShadow = 410,
eCSSPropertyAlias_WebkitBoxSizing = 411,
eCSSPropertyAlias_WebkitBoxFlex = 412,
eCSSPropertyAlias_WebkitBoxOrdinalGroup = 413,
eCSSPropertyAlias_WebkitBoxAlign = 414,
eCSSPropertyAlias_WebkitBoxPack = 415,
eCSSPropertyAlias_WebkitUserSelect = 416,
eCSSProperty_COUNT_with_aliases = 417,
eCSSPropertyExtra_all_properties = 418,
eCSSPropertyExtra_x_none_value = 419,
eCSSPropertyExtra_x_auto_value = 420,
eCSSPropertyExtra_variable = 421,
eCSSProperty_box_pack = 70,
eCSSProperty_box_shadow = 71,
eCSSProperty_box_sizing = 72,
eCSSProperty_caption_side = 73,
eCSSProperty_clear = 74,
eCSSProperty_clip = 75,
eCSSProperty_clip_path = 76,
eCSSProperty_clip_rule = 77,
eCSSProperty_color = 78,
eCSSProperty_color_adjust = 79,
eCSSProperty_color_interpolation = 80,
eCSSProperty_color_interpolation_filters = 81,
eCSSProperty__moz_column_count = 82,
eCSSProperty__moz_column_fill = 83,
eCSSProperty__moz_column_gap = 84,
eCSSProperty__moz_column_rule_color = 85,
eCSSProperty__moz_column_rule_style = 86,
eCSSProperty__moz_column_rule_width = 87,
eCSSProperty__moz_column_width = 88,
eCSSProperty_contain = 89,
eCSSProperty_content = 90,
eCSSProperty__moz_control_character_visibility = 91,
eCSSProperty_counter_increment = 92,
eCSSProperty_counter_reset = 93,
eCSSProperty_cursor = 94,
eCSSProperty_direction = 95,
eCSSProperty_display = 96,
eCSSProperty_dominant_baseline = 97,
eCSSProperty_empty_cells = 98,
eCSSProperty_fill = 99,
eCSSProperty_fill_opacity = 100,
eCSSProperty_fill_rule = 101,
eCSSProperty_filter = 102,
eCSSProperty_flex_basis = 103,
eCSSProperty_flex_direction = 104,
eCSSProperty_flex_grow = 105,
eCSSProperty_flex_shrink = 106,
eCSSProperty_flex_wrap = 107,
eCSSProperty_float = 108,
eCSSProperty_float_edge = 109,
eCSSProperty_flood_color = 110,
eCSSProperty_flood_opacity = 111,
eCSSProperty_font_family = 112,
eCSSProperty_font_feature_settings = 113,
eCSSProperty_font_kerning = 114,
eCSSProperty_font_language_override = 115,
eCSSProperty_font_size = 116,
eCSSProperty_font_size_adjust = 117,
eCSSProperty_font_stretch = 118,
eCSSProperty_font_style = 119,
eCSSProperty_font_synthesis = 120,
eCSSProperty_font_variant_alternates = 121,
eCSSProperty_font_variant_caps = 122,
eCSSProperty_font_variant_east_asian = 123,
eCSSProperty_font_variant_ligatures = 124,
eCSSProperty_font_variant_numeric = 125,
eCSSProperty_font_variant_position = 126,
eCSSProperty_font_weight = 127,
eCSSProperty_force_broken_image_icon = 128,
eCSSProperty_grid_auto_columns = 129,
eCSSProperty_grid_auto_flow = 130,
eCSSProperty_grid_auto_rows = 131,
eCSSProperty_grid_column_end = 132,
eCSSProperty_grid_column_gap = 133,
eCSSProperty_grid_column_start = 134,
eCSSProperty_grid_row_end = 135,
eCSSProperty_grid_row_gap = 136,
eCSSProperty_grid_row_start = 137,
eCSSProperty_grid_template_areas = 138,
eCSSProperty_grid_template_columns = 139,
eCSSProperty_grid_template_rows = 140,
eCSSProperty_height = 141,
eCSSProperty_hyphens = 142,
eCSSProperty_image_orientation = 143,
eCSSProperty_image_region = 144,
eCSSProperty_image_rendering = 145,
eCSSProperty_ime_mode = 146,
eCSSProperty_inline_size = 147,
eCSSProperty_isolation = 148,
eCSSProperty_justify_content = 149,
eCSSProperty_justify_items = 150,
eCSSProperty_justify_self = 151,
eCSSProperty__x_lang = 152,
eCSSProperty_left = 153,
eCSSProperty_letter_spacing = 154,
eCSSProperty_lighting_color = 155,
eCSSProperty_line_height = 156,
eCSSProperty_list_style_image = 157,
eCSSProperty_list_style_position = 158,
eCSSProperty_list_style_type = 159,
eCSSProperty_margin_block_end = 160,
eCSSProperty_margin_block_start = 161,
eCSSProperty_margin_bottom = 162,
eCSSProperty_margin_inline_end = 163,
eCSSProperty_margin_inline_start = 164,
eCSSProperty_margin_left = 165,
eCSSProperty_margin_right = 166,
eCSSProperty_margin_top = 167,
eCSSProperty_marker_end = 168,
eCSSProperty_marker_mid = 169,
eCSSProperty_marker_offset = 170,
eCSSProperty_marker_start = 171,
eCSSProperty_mask = 172,
eCSSProperty_mask_type = 173,
eCSSProperty_math_display = 174,
eCSSProperty_math_variant = 175,
eCSSProperty_max_block_size = 176,
eCSSProperty_max_height = 177,
eCSSProperty_max_inline_size = 178,
eCSSProperty_max_width = 179,
eCSSProperty_min_block_size = 180,
eCSSProperty__moz_min_font_size_ratio = 181,
eCSSProperty_min_height = 182,
eCSSProperty_min_inline_size = 183,
eCSSProperty_min_width = 184,
eCSSProperty_mix_blend_mode = 185,
eCSSProperty_object_fit = 186,
eCSSProperty_object_position = 187,
eCSSProperty_offset_block_end = 188,
eCSSProperty_offset_block_start = 189,
eCSSProperty_offset_inline_end = 190,
eCSSProperty_offset_inline_start = 191,
eCSSProperty_opacity = 192,
eCSSProperty_order = 193,
eCSSProperty_orient = 194,
eCSSProperty_osx_font_smoothing = 195,
eCSSProperty_outline_color = 196,
eCSSProperty_outline_offset = 197,
eCSSProperty__moz_outline_radius_bottomLeft = 198,
eCSSProperty__moz_outline_radius_bottomRight = 199,
eCSSProperty__moz_outline_radius_topLeft = 200,
eCSSProperty__moz_outline_radius_topRight = 201,
eCSSProperty_outline_style = 202,
eCSSProperty_outline_width = 203,
eCSSProperty_overflow_clip_box = 204,
eCSSProperty_overflow_x = 205,
eCSSProperty_overflow_y = 206,
eCSSProperty_padding_block_end = 207,
eCSSProperty_padding_block_start = 208,
eCSSProperty_padding_bottom = 209,
eCSSProperty_padding_inline_end = 210,
eCSSProperty_padding_inline_start = 211,
eCSSProperty_padding_left = 212,
eCSSProperty_padding_right = 213,
eCSSProperty_padding_top = 214,
eCSSProperty_page_break_after = 215,
eCSSProperty_page_break_before = 216,
eCSSProperty_page_break_inside = 217,
eCSSProperty_paint_order = 218,
eCSSProperty_perspective = 219,
eCSSProperty_perspective_origin = 220,
eCSSProperty_pointer_events = 221,
eCSSProperty_position = 222,
eCSSProperty_quotes = 223,
eCSSProperty_resize = 224,
eCSSProperty_right = 225,
eCSSProperty_ruby_align = 226,
eCSSProperty_ruby_position = 227,
eCSSProperty_script_level = 228,
eCSSProperty_script_min_size = 229,
eCSSProperty_script_size_multiplier = 230,
eCSSProperty_scroll_behavior = 231,
eCSSProperty_scroll_snap_coordinate = 232,
eCSSProperty_scroll_snap_destination = 233,
eCSSProperty_scroll_snap_points_x = 234,
eCSSProperty_scroll_snap_points_y = 235,
eCSSProperty_scroll_snap_type_x = 236,
eCSSProperty_scroll_snap_type_y = 237,
eCSSProperty_shape_rendering = 238,
eCSSProperty__x_span = 239,
eCSSProperty_stack_sizing = 240,
eCSSProperty_stop_color = 241,
eCSSProperty_stop_opacity = 242,
eCSSProperty_stroke = 243,
eCSSProperty_stroke_dasharray = 244,
eCSSProperty_stroke_dashoffset = 245,
eCSSProperty_stroke_linecap = 246,
eCSSProperty_stroke_linejoin = 247,
eCSSProperty_stroke_miterlimit = 248,
eCSSProperty_stroke_opacity = 249,
eCSSProperty_stroke_width = 250,
eCSSProperty__x_system_font = 251,
eCSSProperty__moz_tab_size = 252,
eCSSProperty_table_layout = 253,
eCSSProperty_text_align = 254,
eCSSProperty_text_align_last = 255,
eCSSProperty_text_anchor = 256,
eCSSProperty_text_combine_upright = 257,
eCSSProperty_text_decoration_color = 258,
eCSSProperty_text_decoration_line = 259,
eCSSProperty_text_decoration_style = 260,
eCSSProperty_text_emphasis_color = 261,
eCSSProperty_text_emphasis_position = 262,
eCSSProperty_text_emphasis_style = 263,
eCSSProperty__webkit_text_fill_color = 264,
eCSSProperty_text_indent = 265,
eCSSProperty_text_orientation = 266,
eCSSProperty_text_overflow = 267,
eCSSProperty_text_rendering = 268,
eCSSProperty_text_shadow = 269,
eCSSProperty_text_size_adjust = 270,
eCSSProperty__webkit_text_stroke_color = 271,
eCSSProperty__webkit_text_stroke_width = 272,
eCSSProperty_text_transform = 273,
eCSSProperty__x_text_zoom = 274,
eCSSProperty_top = 275,
eCSSProperty__moz_top_layer = 276,
eCSSProperty_touch_action = 277,
eCSSProperty_transform = 278,
eCSSProperty_transform_box = 279,
eCSSProperty_transform_origin = 280,
eCSSProperty_transform_style = 281,
eCSSProperty_transition_delay = 282,
eCSSProperty_transition_duration = 283,
eCSSProperty_transition_property = 284,
eCSSProperty_transition_timing_function = 285,
eCSSProperty_unicode_bidi = 286,
eCSSProperty_user_focus = 287,
eCSSProperty_user_input = 288,
eCSSProperty_user_modify = 289,
eCSSProperty_user_select = 290,
eCSSProperty_vector_effect = 291,
eCSSProperty_vertical_align = 292,
eCSSProperty_visibility = 293,
eCSSProperty_white_space = 294,
eCSSProperty_width = 295,
eCSSProperty_will_change = 296,
eCSSProperty__moz_window_dragging = 297,
eCSSProperty__moz_window_shadow = 298,
eCSSProperty_word_break = 299,
eCSSProperty_word_spacing = 300,
eCSSProperty_word_wrap = 301,
eCSSProperty_writing_mode = 302,
eCSSProperty_z_index = 303,
eCSSProperty_COUNT_no_shorthands = 304,
eCSSProperty_animation = 305,
eCSSProperty_background = 306,
eCSSProperty_border = 307,
eCSSProperty_border_block_end = 308,
eCSSProperty_border_block_start = 309,
eCSSProperty_border_bottom = 310,
eCSSProperty_border_color = 311,
eCSSProperty_border_image = 312,
eCSSProperty_border_inline_end = 313,
eCSSProperty_border_inline_start = 314,
eCSSProperty_border_left = 315,
eCSSProperty_border_radius = 316,
eCSSProperty_border_right = 317,
eCSSProperty_border_style = 318,
eCSSProperty_border_top = 319,
eCSSProperty_border_width = 320,
eCSSProperty__moz_column_rule = 321,
eCSSProperty__moz_columns = 322,
eCSSProperty_flex = 323,
eCSSProperty_flex_flow = 324,
eCSSProperty_font = 325,
eCSSProperty_font_variant = 326,
eCSSProperty_grid = 327,
eCSSProperty_grid_area = 328,
eCSSProperty_grid_column = 329,
eCSSProperty_grid_gap = 330,
eCSSProperty_grid_row = 331,
eCSSProperty_grid_template = 332,
eCSSProperty_list_style = 333,
eCSSProperty_margin = 334,
eCSSProperty_marker = 335,
eCSSProperty_outline = 336,
eCSSProperty__moz_outline_radius = 337,
eCSSProperty_overflow = 338,
eCSSProperty_padding = 339,
eCSSProperty_scroll_snap_type = 340,
eCSSProperty_text_decoration = 341,
eCSSProperty_text_emphasis = 342,
eCSSProperty__webkit_text_stroke = 343,
eCSSProperty__moz_transform = 344,
eCSSProperty_transition = 345,
eCSSProperty_COUNT = 346,
eCSSPropertyAlias_MozPerspectiveOrigin = 347,
eCSSPropertyAlias_MozPerspective = 348,
eCSSPropertyAlias_MozTransformStyle = 349,
eCSSPropertyAlias_MozBackfaceVisibility = 350,
eCSSPropertyAlias_MozBorderImage = 351,
eCSSPropertyAlias_MozTransition = 352,
eCSSPropertyAlias_MozTransitionDelay = 353,
eCSSPropertyAlias_MozTransitionDuration = 354,
eCSSPropertyAlias_MozTransitionProperty = 355,
eCSSPropertyAlias_MozTransitionTimingFunction = 356,
eCSSPropertyAlias_MozAnimation = 357,
eCSSPropertyAlias_MozAnimationDelay = 358,
eCSSPropertyAlias_MozAnimationDirection = 359,
eCSSPropertyAlias_MozAnimationDuration = 360,
eCSSPropertyAlias_MozAnimationFillMode = 361,
eCSSPropertyAlias_MozAnimationIterationCount = 362,
eCSSPropertyAlias_MozAnimationName = 363,
eCSSPropertyAlias_MozAnimationPlayState = 364,
eCSSPropertyAlias_MozAnimationTimingFunction = 365,
eCSSPropertyAlias_MozBoxSizing = 366,
eCSSPropertyAlias_MozFontFeatureSettings = 367,
eCSSPropertyAlias_MozFontLanguageOverride = 368,
eCSSPropertyAlias_MozPaddingEnd = 369,
eCSSPropertyAlias_MozPaddingStart = 370,
eCSSPropertyAlias_MozMarginEnd = 371,
eCSSPropertyAlias_MozMarginStart = 372,
eCSSPropertyAlias_MozBorderEnd = 373,
eCSSPropertyAlias_MozBorderEndColor = 374,
eCSSPropertyAlias_MozBorderEndStyle = 375,
eCSSPropertyAlias_MozBorderEndWidth = 376,
eCSSPropertyAlias_MozBorderStart = 377,
eCSSPropertyAlias_MozBorderStartColor = 378,
eCSSPropertyAlias_MozBorderStartStyle = 379,
eCSSPropertyAlias_MozBorderStartWidth = 380,
eCSSPropertyAlias_MozHyphens = 381,
eCSSPropertyAlias_WebkitAnimation = 382,
eCSSPropertyAlias_WebkitAnimationDelay = 383,
eCSSPropertyAlias_WebkitAnimationDirection = 384,
eCSSPropertyAlias_WebkitAnimationDuration = 385,
eCSSPropertyAlias_WebkitAnimationFillMode = 386,
eCSSPropertyAlias_WebkitAnimationIterationCount = 387,
eCSSPropertyAlias_WebkitAnimationName = 388,
eCSSPropertyAlias_WebkitAnimationPlayState = 389,
eCSSPropertyAlias_WebkitAnimationTimingFunction = 390,
eCSSPropertyAlias_WebkitFilter = 391,
eCSSPropertyAlias_WebkitTextSizeAdjust = 392,
eCSSPropertyAlias_WebkitTransform = 393,
eCSSPropertyAlias_WebkitTransformOrigin = 394,
eCSSPropertyAlias_WebkitTransformStyle = 395,
eCSSPropertyAlias_WebkitBackfaceVisibility = 396,
eCSSPropertyAlias_WebkitPerspective = 397,
eCSSPropertyAlias_WebkitPerspectiveOrigin = 398,
eCSSPropertyAlias_WebkitTransition = 399,
eCSSPropertyAlias_WebkitTransitionDelay = 400,
eCSSPropertyAlias_WebkitTransitionDuration = 401,
eCSSPropertyAlias_WebkitTransitionProperty = 402,
eCSSPropertyAlias_WebkitTransitionTimingFunction = 403,
eCSSPropertyAlias_WebkitBorderRadius = 404,
eCSSPropertyAlias_WebkitBorderTopLeftRadius = 405,
eCSSPropertyAlias_WebkitBorderTopRightRadius = 406,
eCSSPropertyAlias_WebkitBorderBottomLeftRadius = 407,
eCSSPropertyAlias_WebkitBorderBottomRightRadius = 408,
eCSSPropertyAlias_WebkitBackgroundClip = 409,
eCSSPropertyAlias_WebkitBackgroundOrigin = 410,
eCSSPropertyAlias_WebkitBackgroundSize = 411,
eCSSPropertyAlias_WebkitBorderImage = 412,
eCSSPropertyAlias_WebkitBoxShadow = 413,
eCSSPropertyAlias_WebkitBoxSizing = 414,
eCSSPropertyAlias_WebkitBoxFlex = 415,
eCSSPropertyAlias_WebkitBoxOrdinalGroup = 416,
eCSSPropertyAlias_WebkitBoxOrient = 417,
eCSSPropertyAlias_WebkitBoxDirection = 418,
eCSSPropertyAlias_WebkitBoxAlign = 419,
eCSSPropertyAlias_WebkitBoxPack = 420,
eCSSPropertyAlias_WebkitUserSelect = 421,
eCSSProperty_COUNT_with_aliases = 422,
eCSSPropertyExtra_all_properties = 423,
eCSSPropertyExtra_x_none_value = 424,
eCSSPropertyExtra_x_auto_value = 425,
eCSSPropertyExtra_variable = 426,
}
#[repr(i32)]
#[derive(Debug, Copy, Clone)]
@ -3488,8 +3502,7 @@ pub enum nsCSSPropertyLogicalGroup {
eCSSPropertyLogicalGroup_Padding = 6,
eCSSPropertyLogicalGroup_MinSize = 7,
eCSSPropertyLogicalGroup_Size = 8,
eCSSPropertyLogicalGroup_WebkitBoxOrient = 9,
eCSSPropertyLogicalGroup_COUNT = 10,
eCSSPropertyLogicalGroup_COUNT = 9,
}
pub type nscolor = u32;
/**
@ -4230,6 +4243,7 @@ fn bindgen_test_layout_nsStyleCorners() {
assert_eq!(::std::mem::align_of::<nsStyleCorners>() , 8usize);
}
pub enum imgIContainer { }
pub enum imgINotificationObserver { }
#[repr(C)]
pub struct imgIRequest {
pub _bindgen_opaque_blob: u64,
@ -4778,16 +4792,18 @@ pub struct nsStyleText {
pub mTabSize: i32,
pub mTextEmphasisColor: nscolor,
pub mWebkitTextFillColor: nscolor,
pub mWebkitTextStrokeColor: nscolor,
pub mWordSpacing: nsStyleCoord,
pub mLetterSpacing: nsStyleCoord,
pub mLineHeight: nsStyleCoord,
pub mTextIndent: nsStyleCoord,
pub mWebkitTextStrokeWidth: nsStyleCoord,
pub mTextShadow: RefPtr<nsCSSShadowArray>,
pub mTextEmphasisStyleString: nsString,
}
#[test]
fn bindgen_test_layout_nsStyleText() {
assert_eq!(::std::mem::size_of::<nsStyleText>() , 120usize);
assert_eq!(::std::mem::size_of::<nsStyleText>() , 136usize);
assert_eq!(::std::mem::align_of::<nsStyleText>() , 8usize);
}
#[repr(C)]

View file

@ -182,8 +182,10 @@ pub extern "C" fn Servo_GetComputedValues(element: *mut RawGeckoElement)
#[no_mangle]
pub extern "C" fn Servo_GetComputedValuesForAnonymousBox(_parentStyleOrNull: *mut ServoComputedValues,
_pseudoTag: *mut nsIAtom)
_pseudoTag: *mut nsIAtom,
raw_data: *mut RawServoStyleSet)
-> *mut ServoComputedValues {
let _data = PerDocumentStyleData::borrow_mut_from_raw(raw_data);
unimplemented!();
}

View file

@ -125,15 +125,13 @@ def is_border_style_masked(ffi_name):
def get_gecko_property(ffi_name):
if is_border_style_masked(ffi_name):
return "(self.gecko.%s & (gecko_style_structs::BORDER_STYLE_MASK as u8))" % ffi_name
else:
return "self.gecko.%s" % ffi_name
return "self.gecko.%s" % ffi_name
def set_gecko_property(ffi_name, expr):
if is_border_style_masked(ffi_name):
return "self.gecko.%s &= !(gecko_style_structs::BORDER_STYLE_MASK as u8);" % ffi_name + \
"self.gecko.%s |= %s as u8;" % (ffi_name, expr)
else:
return "self.gecko.%s = %s;" % (ffi_name, expr)
return "self.gecko.%s = %s;" % (ffi_name, expr)
%>
<%def name="impl_keyword_setter(ident, gecko_ffi_name, keyword)">
@ -251,7 +249,7 @@ impl Debug for ${style_struct.gecko_ffi_name} {
# Enum class instead of NS_STYLE_...
force_stub += ["box-sizing"]
# Inconsistent constant naming in gecko
force_stub += ["unicode-bidi", "text-transform"]
force_stub += ["text-transform"]
# These are booleans.
force_stub += ["page-break-after", "page-break-before"]
@ -360,10 +358,14 @@ for side in SIDES:
}
</%self:impl_trait>
<%self:impl_trait style_struct_name="Font" skip_longhands="font-size">
<%self:impl_trait style_struct_name="Font" skip_longhands="font-size" skip_additionals="*">
// FIXME(bholley): This doesn't handle zooming properly.
<% impl_app_units("font_size", "mSize", need_clone=True) %>
// This is used for PartialEq, which we don't implement for gecko style structs.
fn compute_font_hash(&mut self) {}
</%self:impl_trait>
<%self:impl_trait style_struct_name="Box" skip_longhands="display overflow-y">

View file

@ -8,10 +8,6 @@ work.
You can see a description of them below.
## `build_custom_clang.sh`
Download a patched LLVM which is needed to use bindgen properly with C++.
## `setup_bindgen.sh`
This uses downloads a custom version of bindgen, up to date to generate the

View file

@ -1,24 +0,0 @@
#!/bin/bash
# Run in the tools directory.
cd "$(dirname $0)"
# Don't run twice.
if [ -d llvm ]; then
echo "llvm directory already exists."
exit 1
fi
# Download and build a custom llvm
git clone https://github.com/llvm-mirror/llvm
cd llvm
git checkout release_38
cd tools
git clone https://github.com/llvm-mirror/clang
cd clang
git checkout release_38
cd ../.. # llvm root dir
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j8

View file

@ -14,11 +14,19 @@ if [ ! -d rust-bindgen ]; then
exit 1
fi
export RUST_BACKTRACE=1
export LIBCLANG_PATH="$(pwd)/llvm/build/Release+Asserts/lib"
export DYLD_LIBRARY_PATH="$(pwd)/llvm/build/Release+Asserts/lib"
export LD_LIBRARY_PATH="$(pwd)/llvm/build/Release+Asserts/lib"
export DIST_INCLUDE="$1/dist/include"
# Check for /usr/include
if [ ! -d /usr/include ]; then
echo "/usr/include doesn't exist. Mac users may need to run xcode-select --install."
exit 1
fi
if [ "$(uname)" == "Linux" ]; then
PLATFORM_DEPENDENT_DEFINES+="-DOS_LINUX";
LIBCLANG_PATH=/usr/lib/llvm-3.8/lib;
else
PLATFORM_DEPENDENT_DEFINES+="-DOS_MACOSX";
LIBCLANG_PATH=`brew --prefix llvm38`/lib/llvm-3.8/lib;
fi
# Prevent bindgen from generating opaque types for the gecko style structs.
export MAP_GECKO_STRUCTS=""
@ -30,26 +38,24 @@ for STRUCT in nsStyleFont nsStyleColor nsStyleList nsStyleText \
nsStyleOutline nsStyleXUL nsStyleSVGReset nsStyleColumn nsStyleEffects
do
MAP_GECKO_STRUCTS=$MAP_GECKO_STRUCTS"-blacklist-type $STRUCT "
MAP_GECKO_STRUCTS=$MAP_GECKO_STRUCTS"-raw-line 'use gecko_style_structs::$STRUCT;'$'\n' "
MAP_GECKO_STRUCTS=$MAP_GECKO_STRUCTS"-raw-line 'use gecko_style_structs::$STRUCT;' "
done
# Check for the include directory.
export DIST_INCLUDE="$1/dist/include"
if [ ! -d "$DIST_INCLUDE" ]; then
echo "$DIST_INCLUDE: directory not found"
exit 1
fi
export RUST_BACKTRACE=1
# We need to use 'eval' here to make MAP_GECKO_STRUCTS evaluate properly as
# multiple arguments.
#
# Uncomment the following line to run rust-bindgen in a debugger on mac.
# The absolute path is required to allow launching lldb with an untrusted
# library in DYLD_LIBRARY_PATH.
#
# /Applications/Xcode.app/Contents/Developer/usr/bin/lldb --
eval ./rust-bindgen/target/debug/bindgen \
-x c++ -std=gnu++0x \
"-I$DIST_INCLUDE" \
$PLATFORM_DEPENDENT_DEFINES \
-o ../bindings.rs \
-no-type-renaming \
"$DIST_INCLUDE/mozilla/ServoBindings.h" \

View file

@ -14,49 +14,34 @@ if [ ! -d rust-bindgen ]; then
exit 1
fi
# Need to find a way to avoid hardcoding these
export RUST_BACKTRACE=1
export LIBCLANG_PATH="$(pwd)/llvm/build/Release+Asserts/lib"
export DYLD_LIBRARY_PATH="$(pwd)/llvm/build/Release+Asserts/lib"
export LD_LIBRARY_PATH="$(pwd)/llvm/build/Release+Asserts/lib"
export DIST_INCLUDE="$1/dist/include"
CLANG_SEARCH_DIRS=$(clang++ -E -x c++ - -v < /dev/null 2>&1 | awk '{ \
if ($0 == "#include <...> search starts here:") \
in_headers = 1; \
else if ($0 == "End of search list.") \
in_headers = 0; \
else if (in_headers == 1) { \
gsub(/^[ \t]+/, "", $0); \
gsub(/[ \t].+$/, "", $0); \
printf " -isystem %s", $0; \
}
}' | sed -e s/:$//g)
# Check for /usr/include
if [ ! -d /usr/include ]; then
echo "/usr/include doesn't exist. Mac users may need to run xcode-select --install."
exit 1
fi
if [ "$(uname)" == "Linux" ]; then
PLATFORM_DEPENDENT_DEFINES+="-DOS_LINUX";
LIBCLANG_PATH=/usr/lib/llvm-3.8/lib;
else
PLATFORM_DEPENDENT_DEFINES+="-DOS_MACOSX";
LIBCLANG_PATH=`brew --prefix llvm38`/lib/llvm-3.8/lib;
fi
# Check for the include directory.
export DIST_INCLUDE="$1/dist/include"
if [ ! -d "$DIST_INCLUDE" ]; then
echo "$DIST_INCLUDE: directory not found"
exit 1
fi
PLATFORM_DEPENDENT_DEFINES="";
if [ "$(uname)" == "Linux" ]; then
PLATFORM_DEPENDENT_DEFINES+="-DOS_LINUX";
else
PLATFORM_DEPENDENT_DEFINES+="-DOS_MACOSX";
fi
export RUST_BACKTRACE=1
# Uncomment the following line to run rust-bindgen in a debugger on mac. The
# absolute path is required to allow launching lldb with an untrusted library
# in DYLD_LIBRARY_PATH.
#
# /Applications/Xcode.app/Contents/Developer/usr/bin/lldb --
# gdb -ex "break rust_panic" -ex run --args \
# -enable-cxx-namespaces \
./rust-bindgen/target/debug/bindgen \
-o ../gecko_style_structs.rs \
-x c++ -std=gnu++0x \
-allow-unknown-types \
$CLANG_SEARCH_DIRS \
"-I$DIST_INCLUDE" "-I$DIST_INCLUDE/nspr" \
"-I$1/../nsprpub/pr/include" \
$PLATFORM_DEPENDENT_DEFINES \

View file

@ -4,17 +4,21 @@
cd "$(dirname $0)"
# Setup and build bindgen.
export LIBCLANG_PATH="$(pwd)/llvm/build/lib"
export LD_LIBRARY_PATH="$(pwd)/llvm/build/lib"
export DYLD_LIBRARY_PATH="$(pwd)/llvm/build/lib"
# Make sure we have a custom clang set up.
if [ ! -d "$LIBCLANG_PATH" ]; then
echo "Custom LLVM/Clang not found. Run build_custom_clang.sh first."
exit 1
if [ "$(uname)" == "Linux" ]; then
LIBCLANG_PATH=/usr/lib/llvm-3.8/lib;
else
LIBCLANG_PATH=`brew --prefix llvm38`/lib/llvm-3.8/lib;
fi
# Make sure we have llvm38.
if [ ! -x "$(command -v clang++-3.8)" ]; then
echo "llmv38 must be installed. Mac users should |brew install llvm38|, Linux varies by distro."
exit 1
fi
export LD_LIBRARY_PATH=$LIBCLANG_PATH
export DYLD_LIBRARY_PATH=$LIBCLANG_PATH
# Check for multirust
if [ ! -x "$(command -v multirust)" ]; then
echo "multirust must be installed."