Minor reorganisation and a few bug fixes.

This commit is contained in:
Patrik Stridvall 2001-07-19 19:10:03 +00:00 committed by Alexandre Julliard
parent 822429ad55
commit 027c7a1f9b
4 changed files with 25 additions and 35 deletions

View File

@ -10,7 +10,7 @@ BEGIN {
} }
use config qw( use config qw(
&file_type &file_skip &files_skip &get_spec_files &file_type &files_skip &files_filter &get_spec_files
$current_dir $wine_dir $winapi_dir $winapi_check_dir $current_dir $wine_dir $winapi_dir $winapi_check_dir
); );
use modules; use modules;

View File

@ -38,7 +38,6 @@ HWND *
IShellFolder ** IShellFolder **
IStream * IStream *
ITEMIDLIST * ITEMIDLIST *
IUnknown *
LPBROWSEINFOA LPBROWSEINFOA
LPBYTE LPBYTE
LPCITEMIDLIST LPCITEMIDLIST
@ -79,7 +78,6 @@ LPVOID *
LPWORD LPWORD
LPWSTR * LPWSTR *
PAPPBARDATA PAPPBARDATA
PLONG
PNOTIFYICONDATAA PNOTIFYICONDATAA
PNOTIFYICONDATAW PNOTIFYICONDATAW
POINT * POINT *

View File

@ -38,6 +38,7 @@ LPARAM
LRESULT LRESULT
SHORT SHORT
UINT UINT
ULONG_PTR
WCHAR WCHAR
WORD WORD
WPARAM WPARAM
@ -70,7 +71,6 @@ COLORREF *
DWORD * DWORD *
DLGPROC DLGPROC
DRAWSTATEPROC DRAWSTATEPROC
FARPROC
GRAYSTRINGPROC GRAYSTRINGPROC
HANDLE * HANDLE *
HICON * HICON *
@ -127,6 +127,7 @@ PVOID
RECT * RECT *
SCROLLINFO * SCROLLINFO *
SECURITY_QUALITY_OF_SERVICE * SECURITY_QUALITY_OF_SERVICE *
SENDASYNCPROC
TIMERPROC TIMERPROC
UINT * UINT *
WINDOWPLACEMENT * WINDOWPLACEMENT *

View File

@ -180,8 +180,7 @@ my %type_found = ();
foreach my $file (@c_files) { foreach my $file (@c_files) {
my %functions = (); my %functions = ();
my @includes = (); my %includes = ();
my %needed_includes = ();
my $file_module16 = $modules->allowed_modules_in_file("$current_dir/$file"); my $file_module16 = $modules->allowed_modules_in_file("$current_dir/$file");
my $file_module32 = $modules->allowed_modules_in_file("$current_dir/$file"); my $file_module32 = $modules->allowed_modules_in_file("$current_dir/$file");
@ -241,8 +240,14 @@ foreach my $file (@c_files) {
} }
} }
if(defined($declared_function)) { if($options->headers_needed && defined($declared_function)) {
$needed_includes{$declared_function->file}++; my $needed_include = $declared_function->file;
if(!defined($includes{$needed_include})) {
my $header = $needed_include;
$header =~ s%^(include|$file_dir)/%%;
$output->write("prototype not included: #include \"$header\" is needed\n");
}
} }
if(1) { if(1) {
@ -399,21 +404,29 @@ foreach my $file (@c_files) {
} }
if(defined($header)) { if(defined($header)) {
my $include;
if(-e "$wine_dir/include/$header") { if(-e "$wine_dir/include/$header") {
push @includes, "include/$header"; $include = "include/$header";
} elsif(-e "$file_dir/$header") { } elsif(-e "$file_dir/$header") {
push @includes, "$file_dir/$header"; $include = "$file_dir/$header";
} elsif(-e "$file_dir/../$header") { } elsif(-e "$file_dir/../$header") {
if($file_dir =~ m%^(.*?)/[^/]+$%) { if($file_dir =~ m%^(.*?)/[^/]+$%) {
push @includes, "$1/$header"; $include = "$1/$header";
} else { } else {
push @includes, "$header"; $include = "$header";
} }
} elsif($header eq "controls.h") { # FIXME: Kludge } elsif($header eq "controls.h") { # FIXME: Kludge
push @includes, "dlls/user/controls.h"; $include = "dlls/user/controls.h";
} elsif($check_local) { } elsif($check_local) {
$output->write("$file: #include \"$header\": file not found\n"); $output->write("$file: #include \"$header\": file not found\n");
} }
if(defined($include)) {
$includes{$include}++;
foreach my $include (keys(%{$include2info{$include}{includes}})) {
$includes{$include}++;
}
}
} }
if($check_protection && $header) { if($check_protection && $header) {
@ -495,28 +508,6 @@ foreach my $file (@c_files) {
} }
} }
if($options->headers_needed) {
my %includes2;
foreach my $include (@includes) {
$includes2{$include}++;
foreach my $include (keys(%{$include2info{$include}{includes}})) {
$includes2{$include}++;
}
}
foreach my $needed_include (sort(keys(%needed_includes))) {
my $found = 0;
foreach my $include (sort(keys(%includes2))) {
if($needed_include eq $include) {
$found = 1;
}
}
if(!$found) {
$output->write("$file: file '$needed_include' needed but not included\n");
}
}
}
winapi_local::check_file $options, $output, $file, \%functions; winapi_local::check_file $options, $output, $file, \%functions;
} }