[CLASSES]: Make cus__emit_struct_definitions register what it defines

So that we don't get duplicates.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-12-23 23:34:42 -02:00
parent 82692a819d
commit ca50c1a52f

View File

@ -2048,6 +2048,17 @@ int cus__emit_struct_definitions(struct cus *self, struct class *class,
struct class_member *pos;
int printed = 0;
if (class->visited)
return 0;
/* Ok, lets look at the previous CUs: */
if (cus__find_definition(self, class->name) != NULL) {
class->visited = 1;
return 0;
}
cus__add_definition(self, class);
list_for_each_entry(pos, &class->members, tag.node)
if (cus__emit_tag_definitions(self, class->cu, &pos->tag))
printed = 1;