Commit e44eb4bc authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

- Added support for auto allocated ordinals

- Fixed varargs (16 bit) bug - Minor fixes
parent f030d752
......@@ -6,3 +6,6 @@ HMENU
HICON
HWND
%ptr
PNOTIFYICONDATAW
......@@ -175,12 +175,12 @@ sub parse_spec_file {
if($header) {
if(/^name\s*(\S*)/) { $module = $1; }
if(/^type\s*(\w+)/) { $type = $1; }
if(/^\d+/) { $header = 0 };
if(/^\d+|@/) { $header = 0 };
next;
}
my $ordinal;
if(/^(\d+)\s+(pascal|pascal16|stdcall|cdecl|register|interrupt|varargs)\s+(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/) {
if(/^(\d+|@)\s+(pascal|pascal16|stdcall|cdecl|register|interrupt|varargs)\s+(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/) {
my $calling_convention = $2;
my $external_name = $3;
my $arguments = $4;
......@@ -196,7 +196,7 @@ sub parse_spec_file {
} elsif($$function_module{$internal_name} !~ /$module/) {
$$function_module{$internal_name} .= " & $module";
}
} elsif(/^(\d+)\s+stub\s+(\S+)$/) {
} elsif(/^(\d+|@)\s+stub\s+(\S+)$/) {
my $external_name = $2;
$ordinal = $1;
......@@ -215,11 +215,11 @@ sub parse_spec_file {
} elsif($$function_module{$internal_name} !~ /$module/) {
$$function_module{$internal_name} .= " & $module";
}
} elsif(/^\d+\s+(equate|long|word|extern|forward)/) {
} elsif(/^(\d+|@)\s+(equate|long|word|extern|forward)/) {
# ignore
} else {
my $next_line = <IN>;
if($next_line =~ /^\d/) {
if($next_line =~ /^\d|@/) {
die "$file: $.: syntax error: '$_'\n";
} else {
$_ .= $next_line;
......@@ -228,7 +228,7 @@ sub parse_spec_file {
}
if(defined($ordinal)) {
if($ordinals{$ordinal}) {
if($ordinal ne "@" && $ordinals{$ordinal}) {
$$output->write("$file: ordinal redefined: $_\n");
}
$ordinals{$ordinal}++;
......
......@@ -125,12 +125,13 @@ foreach my $file ($options->files) {
}
my $file_type;
if($file_dir =~ /^(libtest|program|rc)/) {
if($file_dir =~ /^(libtest|program|rc|tools)/ ||
$file =~ /dbgmain\.c$/ ||
$file =~ /wineclipsrv\.c$/) # FIXME: Kludge
{
$file_type = "application";
} elsif($file_dir =~ /^(debug|miscemu)/) {
$file_type = "emulator";
} elsif($file_dir =~ /^(tools)/) {
$file_type = "tool";
} else {
$file_type = "library";
}
......@@ -156,7 +157,7 @@ foreach my $file ($options->files) {
$win32api->found_function($name) if $options->win32;
}
if($options->local) {
if($options->local && $file_type ne "application") {
my $module16 = $win16api->function_module($name);
my $module32 = $win32api->function_module($name);
......@@ -269,18 +270,20 @@ foreach my $file ($options->files) {
}
};
my $found_conditional = sub {
local $_ = shift;
if(!$nativeapi->is_conditional($_)) {
if(/^HAVE_/ && !/^HAVE_(IPX|MESAGL|BUGGY_MESAGL|WINE_CONSTRUCTOR)$/)
{
$output->write("$file: $_ is not a declared as a conditional\n");
}
} else {
$conditional++;
if(!$config) {
$output->write("$file: conditional $_ used but config.h is not included\n");
}
}
if($file_type ne "application") {
local $_ = shift;
if(!$nativeapi->is_conditional($_)) {
if(/^HAVE_/ && !/^HAVE_(IPX|MESAGL|BUGGY_MESAGL|WINE_CONSTRUCTOR)$/)
{
$output->write("$file: $_ is not a declared as a conditional\n");
}
} else {
$conditional++;
if(!$config) {
$output->write("$file: conditional $_ used but config.h is not included\n");
}
}
}
};
my $preprocessor = 'preprocessor'->new($found_include, $found_conditional);
my $found_preprocessor = sub {
......@@ -291,10 +294,25 @@ foreach my $file ($options->files) {
if($options->config) {
if($directive eq "include") {
my $header;
my $check_protection;
my $check_local;
if($argument =~ /^<(.*?)>$/) {
my $header = $1;
$header = $1;
if($file_type ne "application") {
$check_protection = 1;
} else {
$check_protection = 0;
}
$check_local = 0;
} elsif($argument =~ /^"(.*?)"$/) {
$header = $1;
$check_protection = 0;
$check_local = 1;
}
if((-e "$wine_dir/include/$header" || -e "$file_dir/$header") && $file_type ne "application") {
if($check_protection) {
if((-e "$wine_dir/include/$header" || -e "$file_dir/$header")) {
$output->write("$file: #include \<$header\> is a local include\n");
}
......@@ -306,20 +324,23 @@ foreach my $file ($options->files) {
if(!$preprocessor->is_def($macro)) {
if($macro =~ /^HAVE_X11/) {
if(!$preprocessor->is_undef("X_DISPLAY_MISSING")) {
$output->write("$file: #$directive $argument: is a conditional include, but is not protected\n");
$output->write("$file: #$directive $argument: is a conditional include, " .
"but is not protected\n");
}
} elsif($macro =~ /^HAVE_(.*?)_H$/) {
if($header ne "alloca.h" && !$preprocessor->is_def("STATFS_DEFINED_BY_$1")) {
$output->write("$file: #$directive $argument: is a conditional include, but is not protected\n");
$output->write("$file: #$directive $argument: is a conditional include, " .
"but is not protected\n");
}
}
}
} elsif($preprocessor->is_def($macro)) {
$output->write("$file: #$directive $argument: is protected, but is not a conditional include\n");
$output->write("$file: #$directive $argument: is protected, " .
"but is not a conditional include\n");
}
} elsif($argument =~ /^"(.*?)"$/) {
my $header = $1;
}
if($check_local) {
if(-e "$file_dir/$header") {
$includes{"$file_dir/$header"}{used}++;
foreach my $name (keys(%{$includes{"$file_dir/$header"}{includes}})) {
......
......@@ -58,6 +58,8 @@ sub check_function {
if($winapi->name eq "win16") {
if($calling_convention =~ /^__cdecl$/) {
$implemented_calling_convention = "cdecl";
} elsif($calling_convention =~ /^VFWAPIV|WINAPIV$/) {
$implemented_calling_convention = "varargs";
} elsif($calling_convention = ~ /^__stdcall|VFWAPI|WINAPI$/) {
if($implemented_return_kind =~ /^s_word|word|void$/) {
$implemented_calling_convention = "pascal16";
......@@ -90,7 +92,8 @@ sub check_function {
{
# correct
} elsif($implemented_calling_convention ne $declared_calling_convention &&
!($declared_calling_convention =~ /^pascal/ && $forbidden_return_type))
!($declared_calling_convention =~ /^pascal/ && $forbidden_return_type) &&
!($implemented_calling_convention =~ /^cdecl|varargs$/ && $declared_calling_convention =~ /^cdecl|varargs$/))
{
if($options->calling_convention) {
&$output("calling convention mismatch: $implemented_calling_convention != $declared_calling_convention");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment