diff options
author | Colin Walters <walters@verbum.org> | 2009-02-23 23:04:35 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-02-24 14:23:37 -0500 |
commit | f3f8de20114405bae29a354d67c38a7bf0b096a2 (patch) | |
tree | ae6a6917db11c909f84771da264f7f5930154d09 /giscanner/sourcescanner.c | |
parent | 7bd4bc6807dc829f6e8ea4db1b58a85e365b8b97 (diff) | |
download | gobject-introspection-f3f8de20114405bae29a354d67c38a7bf0b096a2.tar.gz |
Bug 572790 - Don't register #defines from .c files as constants
We keep track of the source filename for every symbol. This enables
us to later filter symbols based on that name.
Diffstat (limited to 'giscanner/sourcescanner.c')
-rw-r--r-- | giscanner/sourcescanner.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/giscanner/sourcescanner.c b/giscanner/sourcescanner.c index 1a2508d9..79d89cdc 100644 --- a/giscanner/sourcescanner.c +++ b/giscanner/sourcescanner.c @@ -60,6 +60,7 @@ gi_source_symbol_unref (GISourceSymbol * symbol) if (symbol->base_type) ctype_free (symbol->base_type); g_free (symbol->const_string); + g_free (symbol->source_filename); g_slice_free (GISourceSymbol, symbol); } } @@ -245,6 +246,11 @@ gi_source_scanner_add_symbol (GISourceScanner *scanner, if (found_filename || scanner->macro_scan) scanner->symbols = g_slist_prepend (scanner->symbols, gi_source_symbol_ref (symbol)); + /* TODO: Refcounted string here or some other optimization */ + if (found_filename && symbol->source_filename == NULL) + { + symbol->source_filename = g_strdup (scanner->current_filename); + } switch (symbol->type) { |