diff options
author | Juerg Billeter <j@bitron.ch> | 2008-05-02 19:00:33 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-05-02 19:00:33 +0000 |
commit | 25ac50eb60554741dfdf0c5a899fe828900a7b71 (patch) | |
tree | 290f6c554c7d7d292f0bfc3a5e434898cfef8da8 /gobject-introspection | |
parent | fba1d053dcd377c2f50a909898afda00a24d4167 (diff) | |
download | vala-25ac50eb60554741dfdf0c5a899fe828900a7b71.tar.gz |
Do not add duplicate symbols, patch by Etienne Bersac, fixes bug 528254
2008-05-02 Juerg Billeter <j@bitron.ch>
* gobject-introspection/scanner.c: (g_igenerator_add_symbol):
Do not add duplicate symbols,
patch by Etienne Bersac, fixes bug 528254
svn path=/trunk/; revision=1332
Diffstat (limited to 'gobject-introspection')
-rw-r--r-- | gobject-introspection/scanner.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gobject-introspection/scanner.c b/gobject-introspection/scanner.c index 01fe0f744..2feb5eac6 100644 --- a/gobject-introspection/scanner.c +++ b/gobject-introspection/scanner.c @@ -1186,6 +1186,7 @@ g_igenerator_add_symbol (GIGenerator * igenerator, CSymbol * symbol) { /* only add symbols of main file */ gboolean found_filename = FALSE; + GList *l; for (l = igenerator->filenames; l != NULL; l = l->next) { @@ -1199,6 +1200,16 @@ g_igenerator_add_symbol (GIGenerator * igenerator, CSymbol * symbol) symbol->directives = g_slist_reverse (igenerator->directives); igenerator->directives = NULL; + /* that's not very optimized ! */ + for (l = igenerator->symbol_list; l != NULL; l = l->next) + { + if (g_str_equal (((CSymbol*)l->data)->ident, symbol->ident)) + { + g_printerr ("Dropping %s duplicate\n", symbol->ident); + return; + } + } + if (found_filename || igenerator->macro_scan) { igenerator->symbol_list = |