Skip to content

Commit

Permalink
Include all dependecies in df headers
Browse files Browse the repository at this point in the history
This allows including df/*.h without including any dependecies first. It
also helps ycm error reporting to avoid wrong errors when opening
headers when it tries to compile header as c++ source file.
  • Loading branch information
suokko committed Jul 7, 2018
1 parent 953a096 commit e93d828
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Bitfield.pm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ sub render_bitfield_core {
emit "static bitfield_identity identity;";
emit "static bitfield_identity *get() { return &identity; }";
} "template<> struct ${export_prefix}identity_$traits_name ", ";";
header_ref("Export.h");
header_ref("DataDefs.h");
};

with_emit_static {
Expand Down
3 changes: 3 additions & 0 deletions Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ sub get_primitive_base($;$) {
my ($tag, $default) = @_;

my $base = $tag->getAttribute('base-type') || $default || 'uint32_t';
if ($base =~ /u?int[136]?[2468]_t/) {
header_ref("cstdint");
}
$primitive_types{$base} or die "Must be primitive: $base\n";

return $base;
Expand Down
2 changes: 2 additions & 0 deletions Enum.pm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ sub render_enum_tables($$$$$$) {
emit "static enum_identity identity;";
emit "static enum_identity *get() { return &identity; }";
} "template<> struct ${export_prefix}identity_$traits_name ", ";";
header_ref("Export.h");
header_ref("DataDefs.h");
};

# Enumerate enum attributes
Expand Down
2 changes: 2 additions & 0 deletions StructFields.pm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ sub with_struct_block(&$;$%) {
my $is_union = is_attr_true($tag,'is-union');
my $kwd = ($is_union ? "union" : "struct");
my $exp = $export_prefix; #$flags{-export} ? $export_prefix : '';
header_ref("Export.h");
header_ref("DataDefs.h");
my $prefix = $kwd.' '.$exp.($name ? $name.' ' : '');

emit_comment $tag, -attr => 1;
Expand Down
1 change: 1 addition & 0 deletions codegen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ BEGIN
my $prefix = get_container_item_type($tag, -weak => 1, -void => 'void');
emit_comment $tag;
emit 'extern ', $export_prefix, $prefix, ' *', $name, ';', get_comment($tag);
header_ref("Export.h");

push @items, [ $prefix, $name ];
push @fields, $tag->findnodes('ld:item');
Expand Down

0 comments on commit e93d828

Please sign in to comment.