Fixes for compatibility.
[wine/testsucceed.git] / tools / winapi_check / winapi_global.pm
blobd58b2849e2c75ed10632b0fdd08f366c6f203158
1 package winapi_global;
3 use strict;
5 use nativeapi qw($nativeapi);
6 use options qw($options);
7 use output qw($output);
8 use winapi qw($win16api $win32api @winapis);
10 sub check {
11 my $type_found = shift;
13 if($options->win16) {
14 _check($win16api, $type_found);
17 if($options->win32) {
18 _check($win32api, $type_found);
22 sub _check {
23 my $winapi = shift;
24 my $type_found = shift;
26 my $winver = $winapi->name;
28 if($options->argument) {
29 foreach my $type ($winapi->all_declared_types) {
30 if(!$$type_found{$type} && !$winapi->is_limited_type($type) && $type ne "CONTEXT86 *") {
31 $output->write("*.c: $winver: ");
32 $output->write("type ($type) not used\n");
37 if($options->argument && $options->argument_forbidden) {
38 my $types_used = $winapi->types_unlimited_used_in_modules;
40 foreach my $type (sort(keys(%$types_used))) {
41 $output->write("*.c: type ($type) only used in module[s] (");
42 my $count = 0;
43 foreach my $module (sort(keys(%{$$types_used{$type}}))) {
44 if($count++) { $output->write(", "); }
45 $output->write("$module");
47 $output->write(")\n");