3 # Copyright 2002 Patrik Stridvall
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 $0 =~ m
%^(.*?
/?tools)/winapi
/winapi_test
$%;
25 require "$1/winapi/setup.pm";
29 file_type files_skip files_filter
30 $current_dir $wine_dir $winapi_dir
32 use output qw($output);
33 use winapi_test_options qw($options);
35 if($options->progress) {
36 $output->enable_progress;
38 $output->disable_progress;
44 use util qw(replace_file);
57 foreach my $test (@tests)
59 foreach my $test_dir ($tests->get_test_dirs($test))
61 foreach my $header ($tests->get_section($test_dir, $test, "header"))
65 push @files, "include/$header";
74 my $file = "tests.dat";
76 $file .= "2"; # FIXME: For tests
78 open(OUT
, "> $winapi_dir/$file") || die "Error: Can't open $winapi_dir/$file: $!\n";
81 my @test_dirs = $tests->get_test_dirs();
82 foreach my $test_dir (@test_dirs) {
83 print OUT
"\n" if $x++;
84 print OUT
"%%%$test_dir\n";
88 my @tests = $tests->get_tests($test_dir);
89 foreach my $test (@tests) {
90 print OUT
"\n" if $y++;
91 print OUT
"%%$test\n";
97 my @sections = $tests->get_sections($test_dir, $test);
98 foreach my $section (@sections) {
99 my @lines = $tests->get_section($test_dir, $test, $section);
101 if ($section =~ /^(?:struct|type)$/) {
102 foreach my $line (@lines) {
108 print OUT
"\n" if $z++;
109 print OUT
"%$section\n";
111 foreach my $line (@lines) {
116 @types = sort { $x = $a; $y = $b; $x =~ s/^!//; $y =~ s/^!//; $x cmp $y } @types;
118 print OUT
"\n" if $z++;
121 foreach my $type (@types) {
135 my $progress_current = 0;
136 my $progress_max = scalar(@files);
138 ########################################################################
144 "ANYSIZE_ARRAY" => 1,
145 "CCHDEVICENAME" => 32,
146 "CCHILDREN_TITLEBAR+1" => 6,
147 "ELF_VENDOR_SIZE" => 4,
148 "EXCEPTION_MAXIMUM_PARAMETERS" => 15,
149 "HW_PROFILE_GUIDLEN" => 39,
150 "IMAGE_NUMBEROF_DIRECTORY_ENTRIES" => 16,
151 "IMAGE_SIZEOF_SHORT_NAME" => 8,
153 "LF_FULLFACESIZE" => 64,
154 "MAXIMUM_SUPPORTED_EXTENSION" => 512,
155 "MAX_GOPHER_DISPLAY_TEXT + 1" => 129,
156 "MAX_GOPHER_LOCATOR_LENGTH + 1" => 654,
158 "MAX_PROFILE_LEN" => 80,
160 "OFS_MAXPATHNAME" => 128,
161 "SIZE_OF_80387_REGISTERS" => 80,
162 "TOKEN_SOURCE_LENGTH" => 8,
165 my %align_kludge_reported = ("FILETIME" => 1, "LARGE_INTEGER" => 1);
166 my %size_kludge_reported = ("FILETIME" => 1, "LARGE_INTEGER" => 1);
167 my %size_parse_reported;
169 sub _find_align_kind_size
($) {
170 my $type_name = shift;
172 local $_ = $type_name;
178 $align = $pointer_size;
180 $size = $pointer_size;
181 } elsif (/^(?:void|VOID)$/) {
189 } elsif(/^(?:(signed|unsigned)\s+)?(?:__int8|char)$/) {
191 $kind = defined($1) ?
$1 : "signed";
197 } elsif(/^(?:byte|BOOLEAN|BYTE|UCHAR)$/) {
201 } elsif (/^(?:(signed|unsigned)\s+)?(?:__int16|short(?:\s+int)?)$/) {
203 $kind = defined($1) ?
$1 : "signed";
205 } elsif (/^SHORT$/) {
209 } elsif (/^(?:char16_t|wchar_t|USHORT|WCHAR|WORD)$/) {
213 } elsif (/^(signed|unsigned)$/) {
217 } elsif (/^(?:(signed|unsigned)\s+)?(?:__int32|int)$/) {
219 $kind = defined($1) ?
$1 : "signed";
221 } elsif (/^(?:BOOL|INT|LONG)$/) {
225 } elsif (/^(?:DWORD|FOURCC|LCID|UINT|ULONG)$/) {
229 } elsif (/^(?:float|FLOAT)$/) {
233 } elsif (/^(?:(signed|unsigned)\s+)?(?:long(?:\s+int)?)$/) {
234 # 'long' is always 4 bytes on Windows.
236 $kind = defined($1) ?
$1 : "signed";
238 } elsif (/^(?:(signed|unsigned)\s+)?__int64$/) {
240 $kind = defined($1) ?
$1 : "signed";
242 } elsif (/^(?:INT64|LONG64|LONGLONG)$/) {
246 } elsif (/^(?:UINT64|ULONG64|DWORD64|ULONGLONG|DWORDLONG)$/) {
250 } elsif (/^(?:double|DOUBLE|DATE)$/) {
254 } elsif (/^(?:long\s+double)$/) {
258 } elsif (/^(?:INT|LONG)_PTR$/) {
259 $align = $pointer_size;
261 $size = $pointer_size;
262 } elsif (/^(?:UINT|MMVERSION|ULONG|DWORD)_PTR$/) {
263 $align = $pointer_size;
265 $size = $pointer_size;
266 } elsif (/^H(?:ANDLE|DC|BITMAP|BRUSH|ICON|INSTANCE|KEY|MENU|METAFILE|MMIO|TASK|WND)$/) {
267 $align = $pointer_size;
269 $size = $pointer_size;
270 } elsif (/^(?:HPSTR|LP[A-Z0-9_]+|PVOID)$/) {
271 $align = $pointer_size;
273 $size = $pointer_size;
274 } elsif (/^POINTS$/) {
278 } elsif (/^(?:FILETIME|LUID|POINT|POINTL)$/) {
282 } elsif (/^(?:CLSID|GUID|RECT|RECTL)$/) {
286 } elsif (/^(?:LARGE_INTEGER)$/) {
290 } elsif (/^(struct|union)$/) {
292 if (!$size_parse_reported{$_}) {
293 $output->write("cannot compute the size and alignment of $type_name types\n");
294 $size_parse_reported{$_} = 1;
296 } elsif (/^\w+\s*\((?:\s*CALLBACK|\s*NTAPI|\s*WINAPI)?\s*\*\s*\)\s*\(.*?\)$/) {
297 $align = $pointer_size;
299 $size = $pointer_size;
303 if (defined(my $type = $type_name2type{$pointer_size}{$_})) {
304 $align2 = $type->align;
307 if (!defined($align)) {
309 } elsif (defined($align2) && !$align_kludge_reported{$_}) {
310 $align_kludge_reported{$_} = 1;
311 $output->write("$type_name: type needn't be kludged\n");
314 if (!defined($align)) {
315 # $output->write("$type_name: can't find type\n");
319 if (defined(my $type = $type_name2type{$pointer_size}{$_})) {
320 $size2 = $type->size;
323 if (!defined($size)) {
325 } elsif (defined($size2) && !$size_kludge_reported{$_}) {
326 $size_kludge_reported{$_} = 1;
327 $output->write("$type_name: type needn't be kludged\n");
330 return ($align, $kind, $size);
334 my $type_name = shift;
335 (my $align, my $kind, my $size) = _find_align_kind_size
($type_name);
340 my $type_name = shift;
341 (my $align, my $kind, my $size) = _find_align_kind_size
($type_name);
347 my $type_name = shift;
348 (my $align, my $kind, my $size) = _find_align_kind_size
($type_name);
354 return $defines{$count};
357 foreach my $file (@files) {
359 foreach my $ptr (4, 8) {
360 $pointer_size = $ptr;
363 open(IN
, "< $wine_dir/$file") || die "Error: Can't open $wine_dir/$file: $!\n";
372 while(s/^.*?\n//) { $max_line++; }
373 if($_) { $max_line++; }
376 my $parser = new c_parser
($file);
383 my $update_output = sub {
387 $progress .= "$file (file $progress_current of $progress_max" . sprintf ", %u-bit)", $pointer_size * 8;
388 $prefix .= "$file: ";
391 $progress .= ": line $line of $max_line";
394 $output->progress($progress);
395 $output->prefix($prefix);
400 my $found_line = sub {
405 $parser->set_found_line_callback($found_line);
407 my $found_preprocessor = sub {
408 my $begin_line = shift;
409 my $begin_column = shift;
410 my $preprocessor = shift;
412 #print "found_preprocessor: $begin_line: [$_]\n";
413 if ($preprocessor =~ /^\#\s*include\s+[\"<]pshpack(\d)\.h[\">]$/) {
414 push @packs, $1 unless @ifdefs && !$ifdefs[$#ifdefs];
415 #print "found pack $1 on line $begin_line\n";
416 } elsif($preprocessor =~ /^\#\s*include\s+[\"<]poppack\.h[\">]$/) {
417 pop @packs unless @ifdefs && !$ifdefs[$#ifdefs];
418 #print "found poppack on line $begin_line\n";
419 } elsif ($preprocessor =~ /^\#\s*ifdef\s+_WIN64/) {
420 push @ifdefs, ($pointer_size == 8);
421 } elsif ($preprocessor =~ /^\#\s*ifndef\s+_WIN64/) {
422 push @ifdefs, ($pointer_size != 8);
423 } elsif ($preprocessor =~ /^\#\s*elif\s+defined\s*\(\s*_WIN64\s*\)/) {
424 $ifdefs[$#ifdefs] = ($pointer_size == 8);
425 } elsif ($preprocessor =~ /^\#\s*ifdef\s/) {
427 } elsif ($preprocessor =~ /^\#\s*ifndef\s/) {
429 } elsif ($preprocessor =~ /^\#\s*if/) {
431 } elsif ($preprocessor =~ /^\#\s*else/) {
432 $ifdefs[$#ifdefs] = $ifdefs[$#ifdefs] ^ 1;
433 } elsif ($preprocessor =~ /^\#\s*elif/) {
434 $ifdefs[$#ifdefs] = 2;
435 } elsif ($preprocessor =~ /^\#\s*endif/) {
440 $parser->set_found_preprocessor_callback($found_preprocessor);
442 my $found_type = sub {
444 return if @ifdefs && !$ifdefs[$#ifdefs];
448 my $name = $type->name;
449 $file2types{$pointer_size}{$file}{$name} = $type;
451 $type->set_find_align_callback(\
&find_align
);
452 $type->set_find_kind_callback(\
&find_kind
);
453 $type->set_find_size_callback(\
&find_size
);
454 $type->set_find_count_callback(\
&find_count
);
456 my $pack = $packs[$#packs];
457 if (!defined($type->pack) && $type->kind =~ /^(?:struct|union)$/) {
460 my $size = $type->size();
461 if (defined($size)) {
462 my $max_field_base_size = 0;
464 foreach my $field ($type->fields()) {
465 my $field_type_name = $field->type_name;
466 my $field_name = $field->name;
467 my $field_size = $field->size;
468 my $field_base_size = $field->base_size;
469 my $field_offset = $field->offset;
470 my $field_align = $field->align;
472 # $output->write("$name: $field_type_name: $field_name: $field_offset: $field_size($field_base_size): $field_align\n");
474 # $output->write("$name: $size\n");
476 $type_name2type{$pointer_size}{$name} = $type;
478 # $output->write("$name: can't find size\n");
483 $parser->set_found_type_callback($found_type);
488 if(!$parser->parse_c_file(\
$_, \
$line, \
$column)) {
489 $output->write("can't parse file\n");
497 ########################################################################
500 sub output_header
($$$) {
503 my $test_dir = shift;
504 my @tests = @
{(shift)};
506 print OUT
"/* File generated automatically from tools/winapi/tests.dat; do not edit! */\n";
507 print OUT
"/* This file can be copied, modified and distributed without restriction. */\n";
511 foreach my $test (@tests) {
512 my @description = $tests->get_section($test_dir, $test, "description");
513 foreach my $description (@description) {
514 print OUT
" * $description\n";
520 print OUT
"#define WINE_NOWINSOCK\n";
522 foreach my $test (@tests) {
523 my @includes = $tests->get_section($test_dir, $test, "include");
524 foreach my $include (@includes) {
525 print OUT
"#include $include\n";
529 print OUT
"#include \"wine/test.h\"\n";
532 print OUT
"/***********************************************************************\n";
533 print OUT
" * Compatibility macros\n";
536 print OUT
"#define DWORD_PTR UINT_PTR\n";
537 print OUT
"#define LONG_PTR INT_PTR\n";
538 print OUT
"#define ULONG_PTR UINT_PTR\n";
541 print OUT
"/***********************************************************************\n";
542 print OUT
" * Windows API extension\n";
545 print OUT
"#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n";
546 print OUT
"# define _TYPE_ALIGNMENT(type) __alignof(type)\n";
547 print OUT
"#elif defined(__GNUC__) || defined(__clang__)\n";
548 print OUT
"# define _TYPE_ALIGNMENT(type) __alignof__(type)\n";
551 print OUT
" * FIXME: May not be possible without a compiler extension\n";
552 print OUT
" * (if type is not just a name that is, otherwise the normal\n";
553 print OUT
" * TYPE_ALIGNMENT can be used)\n";
555 print OUT
"#endif\n";
557 print OUT
"#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)\n";
558 print OUT
"#pragma warning(disable:4116)\n";
559 print OUT
"#endif\n";
561 print OUT
"#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)\n";
562 print OUT
"# define TYPE_ALIGNMENT _TYPE_ALIGNMENT\n";
563 print OUT
"#endif\n";
566 print OUT
"/***********************************************************************\n";
567 print OUT
" * Test helper macros\n";
570 print OUT
"#define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);\n";
572 print OUT
"#ifdef TYPE_ALIGNMENT\n";
573 print OUT
"# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);\n";
575 print OUT
"# define TEST_TYPE_ALIGN(type, align)\n";
576 print OUT
"#endif\n";
578 print OUT
"#ifdef _TYPE_ALIGNMENT\n";
579 print OUT
"# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);\n";
580 print OUT
"# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);\n";
582 print OUT
"# define TEST_TARGET_ALIGN(type, align)\n";
583 print OUT
"# define TEST_FIELD_ALIGN(type, field, align)\n";
584 print OUT
"#endif\n";
586 print OUT
"#define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);\n";
588 print OUT
"#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)\n";
589 print OUT
"#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)\n";
590 print OUT
"#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);\n";
591 print OUT
"#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);\n";
596 ########################################################################
599 sub output_footer
($$$) {
602 my $test_dir = shift;
603 my @tests = @
{(shift)};
605 print OUT
"START_TEST(generated)\n";
607 foreach my $test (@tests) {
608 print OUT
" test_$test();\n";
613 ########################################################################
614 # output_test_pack_type
616 sub output_test_pack_type
($$$$$$) {
619 my $type_name2type = shift;
620 my $type_name2optional = shift;
621 my $type_name2optional_fields = shift;
622 my $type_name = shift;
625 my $optional_fields = $$type_name2optional_fields{$type_name};
627 my $type_align = $type->align;
628 my $type_pack = $type->pack;
629 my $type_size = $type->size;
630 my $type_kind = $type->kind;
632 if (defined($type_pack)) {
633 print OUT
" /* $type_name (pack $type_pack) */\n";
635 print OUT
" /* $type_name */\n";
638 if (!scalar(keys(%$optional_fields)) && defined($type_align) && defined($type_size)) {
639 print OUT
" TEST_TYPE_SIZE ($type_name, $type_size)\n";
640 print OUT
" TEST_TYPE_ALIGN ($type_name, $type_align)\n";
643 if ($type_kind eq "float") {
645 } elsif ($type_kind eq "pointer") {
646 my $dereference_type;
647 $dereference_type = sub {
650 my @fields = $type->fields;
651 my $type_name2 =$fields[0]->type_name;
653 if ($type_name2 =~ s/\s*\*$//) {
654 my $type2 = $$type_name2type{$type_name2};
655 if (defined($type2)) {
658 if ($type_name2 !~ /^(?:PVOID|VOID|void)$/) {
659 $output->write("$type_name2: warning: type not found 1\n");
663 } elsif ($type_name2 =~ /^\w+$/) {
664 my $type2 = $$type_name2type{$type_name2};
665 if (defined($type2)) {
666 return &$dereference_type($type2);
668 $output->write("$type_name2: warning: type not found\n");
671 } elsif ($type_name2 =~ /^\w+\s*\((?:\s*CALLBACK|\s*NTAPI|\s*WINAPI)?\s*\*\s*\)\s*\(.*?\)$/) {
674 $output->write("$type_name2: warning: type can't be parsed\n");
679 my $type2 = &$dereference_type($type);
680 if (defined($type2)) {
681 my $type_name2 = $type2->name;
682 my $type_align2 = $type2->align;
683 my $type_size2 = $type2->size;
685 my $optional = $$type_name2optional{$type_name};
686 my $optional_fields2 = $$type_name2optional_fields{$type_name2};
688 if (!$optional && !scalar(keys(%$optional_fields2)) && defined($type_align2) && defined($type_size2)) {
689 print OUT
" TEST_TARGET_SIZE ($type_name, $type_size2)\n";
690 print OUT
" TEST_TARGET_ALIGN($type_name, $type_align2)\n";
692 # $output->write("$type_name: warning: type size not found\n");
695 } elsif ($type_kind eq "signed") {
696 print OUT
" TEST_TYPE_SIGNED ($type_name)\n";
697 } elsif ($type_kind eq "unsigned") {
698 print OUT
" TEST_TYPE_UNSIGNED($type_name)\n";
702 sub output_test_pack_fields
($$$$$$$);
703 sub output_test_pack_fields
($$$$$$$) {
706 my $type_name2type = shift;
707 my $type_name2optional = shift;
708 my $type_name2optional_fields = shift;
709 my $type_name = shift;
713 my $optional_fields = $$type_name2optional_fields{$type_name};
715 foreach my $field ($type->fields()) {
716 my $field_type_name = $field->type_name;
717 $field_type_name =~ s/\s+DECLSPEC_ALIGN\(\d+\)//;
718 my $field_name = $field->name;
719 my $field_size = $field->size;
720 my $field_offset = $field->offset;
721 my $field_align = $field->align;
723 next if $field_name eq "" || (defined($field_size) && $field_size < 0);
724 # We cannot take the address of a bitfield with MSVC
725 next if ($field_type_name =~ /:/);
727 if ($$optional_fields{$field_name}) {
729 } elsif (defined($field_size) && defined($field_offset)) {
730 $field_offset += $offset;
731 if ($field_name eq "DUMMYSTRUCTNAME") {
732 print OUT
"#ifdef NONAMELESSSTRUCT\n";
733 print OUT
" TEST_TYPE_SIZE ($type_name.$field_name, $field_size)\n";
734 print OUT
" TEST_FIELD_ALIGN ($type_name, $field_name, $field_align)\n";
735 print OUT
" TEST_FIELD_OFFSET($type_name, $field_name, $field_offset)\n";
737 output_test_pack_fields
(\
*OUT
, $type_name2type, $type_name2optional, $type_name2optional_fields,
738 $type_name, $$type_name2type{$field_type_name}, $field_offset);
739 print OUT
"#endif\n";
741 print OUT
" TEST_FIELD_SIZE ($type_name, $field_name, $field_size)\n";
742 print OUT
" TEST_FIELD_ALIGN ($type_name, $field_name, $field_align)\n";
743 print OUT
" TEST_FIELD_OFFSET($type_name, $field_name, $field_offset)\n";
746 # $output->write("$type_name: $field_type_name: $field_name: test not generated (offset not defined)\n");
751 ########################################################################
754 sub output_test_pack
($$$$) {
757 my $test_dir = shift;
760 my $type_names_used = shift;
762 $output->prefix("$test_dir: $test: ");
764 my @headers = $tests->get_section($test_dir, $test, "header");
765 my @type_names = $tests->get_section($test_dir, $test, "type");
767 my %type_name2optional;
768 my %type_name2optional_fields;
770 foreach my $_type_name (@type_names) {
771 my $type_name = $_type_name;
773 if ($type_name =~ s/^!//) {
774 $type_name2optional{$type_name}++;
777 my $optional_fields = {};
778 if ($type_name =~ s/:\s*(.*?)$//) {
779 my @fields = split /\s+/, $1;
780 foreach my $field (@fields) {
781 if ($field =~ s/^!//) {
782 $$optional_fields{$field}++;
787 $type_name2optional_fields{$type_name} = $optional_fields;
790 foreach my $header (@headers) {
791 my $type_name2type = $file2types{$pointer_size}{"include/$header"};
793 foreach my $_type_name (@type_names) {
794 my $type_name = $_type_name;
796 my $skip = ($type_name =~ s/^!//);
797 $type_name =~ s/:.*?$//;
798 my $type = $$type_name2type{$type_name};
799 if (!defined($type)) {
802 $$type_names_used{$type_name} = $skip ?
-1 : 1;
805 print OUT
"static void test_${test}_$type_name(void)\n";
807 output_test_pack_type
(\
*OUT
, $type_name2type, \
%type_name2optional, \
%type_name2optional_fields,
809 output_test_pack_fields
(\
*OUT
, $type_name2type, \
%type_name2optional, \
%type_name2optional_fields,
810 $type_name, $type, 0);
818 ########################################################################
821 sub output_file
($$$$) {
824 my $test_dir = shift;
825 my @tests = @
{(shift)};
827 my $type_names_used = shift;
829 output_header
(\
*OUT
, $test_dir, \
@tests);
831 foreach my $test (@tests) {
832 my %type_names_used2;
834 if ($test eq "pack") {
835 print OUT
"#ifdef _WIN64\n\n";
837 output_test_pack
(\
*OUT
, $test_dir, $test, \
%type_names_used2);
838 print OUT
"#else /* _WIN64 */\n\n";
840 output_test_pack
(\
*OUT
, $test_dir, $test, \
%type_names_used2);
841 print OUT
"#endif /* _WIN64 */\n\n";
843 die "no such test ($test)\n";
846 print OUT
"static void test_$test(void)\n";
848 foreach my $type_name (sort(keys(%type_names_used2))) {
849 $$type_names_used{$type_name} = $type_names_used2{$type_name};
850 if ($type_names_used2{$type_name} > 0) {
851 print OUT
" test_${test}_$type_name();\n";
858 output_footer
(\
*OUT
, $test_dir, \
@tests);
863 ########################################################################
866 my %type_names_used = ();
868 my @test_dirs = $tests->get_test_dirs();
869 foreach my $test_dir (@test_dirs) {
870 my $file = "$wine_dir/$test_dir/generated.c";
871 replace_file
($file, \
&output_file
, $test_dir, \
@tests, \
%type_names_used);
874 foreach my $header (sort(keys(%{$file2types{$pointer_size}}))) {
875 $output->prefix("$header: ");
876 my $type_name2type = $file2types{$pointer_size}{$header};
877 foreach my $_type_name (sort(keys(%$type_name2type))) {
878 my $type_name = $_type_name;
880 if (!exists($type_names_used{$type_name})) {
881 $output->write("$type_name: type not used\n");
886 $output->prefix("$winapi_dir/tests.dat: ");
887 foreach my $type_name (sort(keys(%type_names_used))) {
889 foreach my $header (sort(keys(%{$file2types{$pointer_size}}))) {
890 if (exists($file2types{$pointer_size}{$header}{$type_name})) {
897 $output->write("$type_name: type not used\n");