gtk-doc r660 - trunk
- From: stefkost svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk-doc r660 - trunk
- Date: Fri, 23 Jan 2009 08:52:14 +0000 (UTC)
Author: stefkost
Date: Fri Jan 23 08:52:14 2009
New Revision: 660
URL: http://svn.gnome.org/viewvc/gtk-doc?rev=660&view=rev
Log:
patch by: David NeÄas <yeti physics muni cz>
* gtkdoc-scan.in:
Don't scan files twice. The patch was slightly changed to name the
hash lowercase (uppercase is used for configureation options) and
add a comment. Fixes #568708.
Modified:
trunk/ChangeLog
trunk/gtkdoc-scan.in
Modified: trunk/gtkdoc-scan.in
==============================================================================
--- trunk/gtkdoc-scan.in (original)
+++ trunk/gtkdoc-scan.in Fri Jan 23 08:52:14 2009
@@ -38,6 +38,7 @@
use strict;
use Getopt::Long;
+use Cwd qw(realpath);
unshift @INC, '@PACKAGE_DATA_DIR@';
require "gtkdoc-common.pl";
@@ -140,6 +141,10 @@
my $object_list = "";
my $file;
+# do not read files twice; checking it here permits to give both srcdir and
+# builddir as --source-dir without fear of duplicities
+my %seen_headers;
+
# The header files to scan are passed in as command-line args.
for $file (@ARGV) {
&ScanHeader ($file, \$object_list, \$main_list);
@@ -229,23 +234,23 @@
my ($input_file, $object_list, $main_list) = @_;
my $list = ""; # Holds the resulting list of declarations.
- my ($in_comment) = 0; # True if we are in a comment.
+ my ($in_comment) = 0; # True if we are in a comment.
my ($in_declaration) = ""; # The type of declaration we are in, e.g.
# 'function' or 'macro'.
my ($symbol); # The current symbol being declared.
my ($decl); # Holds the declaration of the current symbol.
my ($ret_type); # For functions and function typedefs this
# holds the function's return type.
- my ($pre_previous_line) = ""; # The pre-previous line read in - some Gnome
+ my ($pre_previous_line) = ""; # The pre-previous line read in - some Gnome
# functions have the return type on one
- # line, the function name on the next,
+ # line, the function name on the next,
# and the rest of the declaration after.
my ($previous_line) = ""; # The previous line read in - some Gnome
# functions have the return type on one line
# and the rest of the declaration after.
my ($first_macro) = 1; # Used to try to skip the standard #ifdef XXX
# #define XXX at the start of headers.
- my ($level); # Used to handle structs which contain nested
+ my ($level); # Used to handle structs which contain nested
# structs or unions.
my @objects = (); # Holds declarations that look like GtkObject
# subclasses, which we remove from the list.
@@ -256,6 +261,11 @@
my $deprecated = "";
+ # Don't scan headers twice
+ my $canonical_input_file = realpath $input_file;
+ return if exists $seen_headers{$canonical_input_file};
+ $seen_headers{$canonical_input_file} = 1;
+
if ($input_file =~ m/^.*[\/\\](.*)\.h+$/) {
$file_basename = $1;
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]