diff --git a/tools/winapi_check/nativeapi.pm b/tools/winapi_check/nativeapi.pm index 2c8c8b5577d..2eadf8ade57 100644 --- a/tools/winapi_check/nativeapi.pm +++ b/tools/winapi_check/nativeapi.pm @@ -19,6 +19,10 @@ sub new { my $configure_in_file = shift; my $config_h_in_file = shift; + $api_file =~ s/^\.\///; + $configure_in_file =~ s/^\.\///; + $config_h_in_file =~ s/^\.\///; + $$output->progress("$api_file"); open(IN, "< $api_file"); diff --git a/tools/winapi_check/output.pm b/tools/winapi_check/output.pm index 0c0fb328e52..596c81f4ebb 100644 --- a/tools/winapi_check/output.pm +++ b/tools/winapi_check/output.pm @@ -10,9 +10,11 @@ sub new { my $progress = \${$self->{PROGRESS}}; my $last_progress = \${$self->{LAST_PROGRESS}}; + my $progress_count = \${$self->{PROGRESS_COUNT}}; $$progress = ""; $$last_progress = ""; + $progress_count = 0; return $self; } @@ -22,8 +24,11 @@ sub show_progress { my $self = shift; my $progress = \${$self->{PROGRESS}}; my $last_progress = \${$self->{LAST_PROGRESS}}; + my $progress_count = \${$self->{PROGRESS_COUNT}}; - if($$progress) { + $$progress_count++; + + if($$progress_count > 0 && $$progress) { print STDERR $$progress; $$last_progress = $$progress; } @@ -33,6 +38,9 @@ sub hide_progress { my $self = shift; my $progress = \${$self->{PROGRESS}}; my $last_progress = \${$self->{LAST_PROGRESS}}; + my $progress_count = \${$self->{PROGRESS_COUNT}}; + + $$progress_count--; if($$last_progress) { my $message; @@ -50,18 +58,20 @@ sub update_progress { my $last_progress = \${$self->{LAST_PROGRESS}}; my $prefix = ""; - for (1..length($$last_progress)) { - $prefix .= ""; - } - my $suffix = ""; - my $diff = length($$last_progress)-length($$progress); - if($diff > 0) { - for (1..$diff) { - $suffix .= " "; + if($$last_progress) { + for (1..length($$last_progress)) { + $prefix .= ""; } - for (1..$diff) { - $suffix .= ""; + + my $diff = length($$last_progress)-length($$progress); + if($diff > 0) { + for (1..$diff) { + $suffix .= " "; + } + for (1..$diff) { + $suffix .= ""; + } } } print STDERR $prefix . $$progress . $suffix; @@ -79,10 +89,10 @@ sub progress { sub write { my $self = shift; - my $last_progress = \${$self->{LAST_PROGRESS}}; my $message = shift; - + + $self->hide_progress; print STDERR $message; $self->show_progress; diff --git a/tools/winapi_check/win32api.dat b/tools/winapi_check/win32api.dat index 4d1e0faa2f6..6ee65d013d8 100644 --- a/tools/winapi_check/win32api.dat +++ b/tools/winapi_check/win32api.dat @@ -465,6 +465,8 @@ LPPROCESS_HEAP_ENTRY * LPPROCESS_INFORMATION LPPROGRESS_ROUTINE LPRASCONNA +LPRASDIALPARAMS +LPRASENTRYNAME LPRASTERIZER_STATUS LPRECT LPRGNDATA @@ -675,6 +677,7 @@ short * struct _TEB * struct ThunkDataCommon * struct find_t * +struct netent * struct sockaddr * struct stat * struct timeval * diff --git a/tools/winapi_check/winapi_check b/tools/winapi_check/winapi_check index 5cddabf85fd..87e6ec079a5 100755 --- a/tools/winapi_check/winapi_check +++ b/tools/winapi_check/winapi_check @@ -78,15 +78,34 @@ my %includes; } split(/\n/, `find . -name \\*.h`); foreach my $file (@files) { + my $file_dir = $file; + if(!($file_dir =~ s/(.*?)\/[^\/]*$/$1/)) { + $file_dir = "."; + } + $includes{$file} = { name => $file }; + open(IN, "< $file"); while(<IN>) { if(/^\s*\#\s*include\s*\"(.*?)\"/) { - $includes{$file}{includes}{"include/$1"}++; + my $header = $1; + if(-e "$file_dir/$header") { + $includes{$file}{includes}{"$file_dir/$header"}++; + } elsif(-e "include/$header") { + $includes{$file}{includes}{"include/$header"}++; + } else { + $output->write("$file: #include \"$header\" is not a local include\n"); + } } } close(IN); } + + my @files2 = ("acconfig.h", "poppack.h", "pshpack1.h", "pshpack2.h", "pshpack4.h", "pshpack8.h"); + + foreach my $file2 (@files2) { + $includes{"include/$file2"}{used}++; + } } my $progress_output; @@ -245,7 +264,7 @@ foreach my $file ($options->files) { my $conditional = 0; my $found_include = sub { local $_ = shift; - if(/^\"config.h\"/) { + if(/^\"(config\.h|native\.h)\"/) { $config++; } }; diff --git a/tools/winapi_check/winapi_options.pm b/tools/winapi_check/winapi_options.pm index 5a504d0e266..b11c67e1dcb 100644 --- a/tools/winapi_check/winapi_options.pm +++ b/tools/winapi_check/winapi_options.pm @@ -65,7 +65,7 @@ my %options = ( "declared" => { default => 1, parent => "global", description => "declared checking" }, "implemented" => { default => 1, parent => "global", description => "implemented checking" }, "implemented-win32" => { default => 0, parent => "implemented", description => "implemented as win32 checking" }, - "include" => { default => 0, parent => "global", description => "include checking" } + "include" => { default => 1, parent => "global", description => "include checking" } ); my %short_options = (