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
23 $0 =~ m
%^(.*?
/?tools)/winapi
/winapi_test
$%;
24 require "$1/winapi/setup.pm";
28 file_type files_skip files_filter
29 $current_dir $wine_dir $winapi_dir
31 use output qw($output);
32 use winapi_test_options qw($options);
34 if($options->progress) {
35 $output->enable_progress;
37 $output->disable_progress;
43 use util qw(replace_file);
56 foreach my $test (@tests)
58 foreach my $test_dir ($tests->get_test_dirs($test))
60 foreach my $header ($tests->get_section($test_dir, $test, "header"))
64 push @files, "include/$header";
73 my $file = "tests.dat";
75 $file .= "2"; # FIXME: For tests
77 open(OUT
, "> $winapi_dir/$file") || die "Error: Can't open $winapi_dir/$file: $!\n";
80 my @test_dirs = $tests->get_test_dirs();
81 foreach my $test_dir (@test_dirs) {
82 print OUT
"\n" if $x++;
83 print OUT
"%%%$test_dir\n";
87 my @tests = $tests->get_tests($test_dir);
88 foreach my $test (@tests) {
89 print OUT
"\n" if $y++;
90 print OUT
"%%$test\n";
96 my @sections = $tests->get_sections($test_dir, $test);
97 foreach my $section (@sections) {
98 my @lines = $tests->get_section($test_dir, $test, $section);
100 if ($section =~ /^(?:struct|type)$/) {
101 foreach my $line (@lines) {
107 print OUT
"\n" if $z++;
108 print OUT
"%$section\n";
110 foreach my $line (@lines) {
115 @types = sort { $x = $a; $y = $b; $x =~ s/^!//; $y =~ s/^!//; $x cmp $y } @types;
117 print OUT
"\n" if $z++;
120 foreach my $type (@types) {
134 my $progress_current = 0;
135 my $progress_max = scalar(@files);
137 ########################################################################
143 "ANYSIZE_ARRAY" => 1,
144 "CCHDEVICENAME" => 32,
145 "CCHILDREN_TITLEBAR+1" => 6,
146 "ELF_VENDOR_SIZE" => 4,
147 "EXCEPTION_MAXIMUM_PARAMETERS" => 15,
148 "HW_PROFILE_GUIDLEN" => 39,
149 "IMAGE_NUMBEROF_DIRECTORY_ENTRIES" => 16,
150 "IMAGE_SIZEOF_SHORT_NAME" => 8,
152 "LF_FULLFACESIZE" => 64,
153 "MAXIMUM_SUPPORTED_EXTENSION" => 512,
154 "MAX_GOPHER_DISPLAY_TEXT + 1" => 129,
155 "MAX_GOPHER_LOCATOR_LENGTH + 1" => 654,
157 "MAX_PROFILE_LEN" => 80,
159 "OFS_MAXPATHNAME" => 128,
160 "SIZE_OF_80387_REGISTERS" => 80,
161 "TOKEN_SOURCE_LENGTH" => 8,
164 my %align_kludge_reported = ("FILETIME" => 1, "LARGE_INTEGER" => 1);
165 my %size_kludge_reported = ("FILETIME" => 1, "LARGE_INTEGER" => 1);
166 my %size_parse_reported;
168 sub _find_align_kind_size
($) {
169 my $type_name = shift;
171 local $_ = $type_name;
177 $align = $pointer_size;
179 $size = $pointer_size;
184 } elsif(/^(?:(signed|unsigned)\s+)?(?:__int8|char|byte)$/) {
186 $kind = defined($1) ?
$1 : "signed";
188 } elsif (/^(?:(signed|unsigned)\s+)?(?:__int16|short(?:\s+int)?)$/) {
190 $kind = defined($1) ?
$1 : "signed";
192 } elsif (/^(?:wchar_t)$/) {
196 } elsif (/^(signed|unsigned)$/) {
198 $kind = defined($1) ?
$1 : "signed";
200 } elsif (/^(?:(signed|unsigned)\s+)?(?:__int32|int)$/) {
202 $kind = defined($1) ?
$1 : "signed";
204 } elsif (/^(?:(signed|unsigned)\s+)?(?:long(?:\s+int)?)$/) {
205 $align = $pointer_size;
206 $kind = defined($1) ?
$1 : "signed";
207 $size = $pointer_size;
208 } elsif (/^(?:float)$/) {
212 } elsif (/^(?:(signed|unsigned)\s+)?__int64$/) {
214 $kind = defined($1) ?
$1 : "signed";
216 } elsif (/^(?:double|DOUBLE|DATE)$/) {
220 } elsif (/^(?:long\s+double)$/) {
224 } elsif (/^H(?:DC|BITMAP|BRUSH|ICON|INSTANCE|KEY|MENU|METAFILE|WND)$/) {
225 $align = $pointer_size;
227 $size = $pointer_size;
228 } elsif (/^LP(?:BYTE|CSTR|CWSTR|DWORD|STR|VOID|WSTR)$/) {
229 $align = $pointer_size;
231 $size = $pointer_size;
232 } elsif (/^(?:FILETIME)$/) {
240 } elsif (/^(?:VOID)$/) {
244 } elsif (/^(?:SHORT)$/) {
248 } elsif (/^(?:BYTE)$/) {
252 } elsif (/^(?:DWORD)$/) {
256 } elsif (/^(?:WORD)$/) {
260 } elsif (/^(?:INT64|LONG64|LONGLONG)$/) {
264 } elsif (/^(?:UINT64|ULONG64|DWORD64|ULONGLONG|DWORDLONG)$/) {
268 } elsif (/^(?:LARGE_INTEGER)$/) {
272 } elsif (/^(?:POINTS)$/) {
276 } elsif (/^(struct|union)$/) {
278 if (!$size_parse_reported{$_}) {
279 $output->write("$type_name: can't parse type\n");
280 $size_parse_reported{$_} = 1;
282 } elsif (/^\w+\s*\((?:\s*CALLBACK|\s*NTAPI|\s*WINAPI)?\s*\*\s*\)\s*\(.*?\)$/) {
283 $align = $pointer_size;
285 $size = $pointer_size;
289 if (defined(my $type = $type_name2type{$pointer_size}{$_})) {
290 $align2 = $type->align;
293 if (!defined($align)) {
295 } elsif (defined($align2) && !$align_kludge_reported{$_}) {
296 $align_kludge_reported{$_} = 1;
297 $output->write("$type_name: type needn't be kludged\n");
300 if (!defined($align)) {
301 # $output->write("$type_name: can't find type\n");
305 if (defined(my $type = $type_name2type{$pointer_size}{$_})) {
306 $size2 = $type->size;
309 if (!defined($size)) {
311 } elsif (defined($size2) && !$size_kludge_reported{$_}) {
312 $size_kludge_reported{$_} = 1;
313 $output->write("$type_name: type needn't be kludged\n");
316 return ($align, $kind, $size);
320 my $type_name = shift;
321 (my $align, my $kind, my $size) = _find_align_kind_size
($type_name);
326 my $type_name = shift;
327 (my $align, my $kind, my $size) = _find_align_kind_size
($type_name);
333 my $type_name = shift;
334 (my $align, my $kind, my $size) = _find_align_kind_size
($type_name);
340 return $defines{$count};
343 foreach my $file (@files) {
345 foreach my $ptr (4, 8) {
346 $pointer_size = $ptr;
349 open(IN
, "< $wine_dir/$file") || die "Error: Can't open $wine_dir/$file: $!\n";
358 while(s/^.*?\n//) { $max_line++; }
359 if($_) { $max_line++; }
362 my $parser = new c_parser
($file);
369 my $update_output = sub {
373 $progress .= "$file (file $progress_current of $progress_max" . sprintf ", %u-bit)", $pointer_size * 8;
374 $prefix .= "$file: ";
377 $progress .= ": line $line of $max_line";
380 $output->progress($progress);
381 $output->prefix($prefix);
386 my $found_line = sub {
391 $parser->set_found_line_callback($found_line);
393 my $found_preprocessor = sub {
394 my $begin_line = shift;
395 my $begin_column = shift;
396 my $preprocessor = shift;
398 #print "found_preprocessor: $begin_line: [$_]\n";
399 if ($preprocessor =~ /^\#\s*include\s+[\"<]pshpack(\d+)\.h[\">]$/) {
400 push @packs, $1 unless @ifdefs && !$ifdefs[$#ifdefs];
401 #print "found pack $1 on line $begin_line\n";
402 } elsif($preprocessor =~ /^\#\s*include\s+[\"<]poppack\.h[\">]$/) {
403 pop @packs unless @ifdefs && !$ifdefs[$#ifdefs];
404 #print "found poppack on line $begin_line\n";
405 } elsif ($preprocessor =~ /^\#\s*ifdef\s+_WIN64/) {
406 push @ifdefs, ($pointer_size == 8);
407 } elsif ($preprocessor =~ /^\#\s*ifndef\s+_WIN64/) {
408 push @ifdefs, ($pointer_size == 4);
409 } elsif ($preprocessor =~ /^\#\s*elif\s+defined(_WIN64)/) {
410 $ifdefs[$#ifdefs] = ($pointer_size == 8);
411 } elsif ($preprocessor =~ /^\#\s*ifdef\s/) {
413 } elsif ($preprocessor =~ /^\#\s*ifndef\s/) {
415 } elsif ($preprocessor =~ /^\#\s*if/) {
417 } elsif ($preprocessor =~ /^\#\s*else/) {
418 $ifdefs[$#ifdefs] = $ifdefs[$#ifdefs] ^ 1;
419 } elsif ($preprocessor =~ /^\#\s*elif/) {
420 $ifdefs[$#ifdefs] = 2;
421 } elsif ($preprocessor =~ /^\#\s*endif/) {
426 $parser->set_found_preprocessor_callback($found_preprocessor);
428 my $found_type = sub {
430 return if @ifdefs && !$ifdefs[$#ifdefs];
434 my $name = $type->name;
435 $file2types{$pointer_size}{$file}{$name} = $type;
437 $type->set_find_align_callback(\
&find_align
);
438 $type->set_find_kind_callback(\
&find_kind
);
439 $type->set_find_size_callback(\
&find_size
);
440 $type->set_find_count_callback(\
&find_count
);
442 my $pack = $packs[$#packs];
443 if (!defined($type->pack) && $type->kind =~ /^(?:struct|union)$/) {
446 my $size = $type->size();
447 if (defined($size)) {
448 my $max_field_base_size = 0;
450 foreach my $field ($type->fields()) {
451 my $field_type_name = $field->type_name;
452 my $field_name = $field->name;
453 my $field_size = $field->size;
454 my $field_base_size = $field->base_size;
455 my $field_offset = $field->offset;
456 my $field_align = $field->align;
458 # $output->write("$name: $field_type_name: $field_name: $field_offset: $field_size($field_base_size): $field_align\n");
460 # $output->write("$name: $size\n");
462 $type_name2type{$pointer_size}{$name} = $type;
464 # $output->write("$name: can't find size\n");
469 $parser->set_found_type_callback($found_type);
474 if(!$parser->parse_c_file(\
$_, \
$line, \
$column)) {
475 $output->write("can't parse file\n");
483 ########################################################################
486 sub output_header
($$$) {
489 my $test_dir = shift;
490 my @tests = @
{(shift)};
492 print OUT
"/* File generated automatically from tools/winapi/tests.dat; do not edit! */\n";
493 print OUT
"/* This file can be copied, modified and distributed without restriction. */\n";
497 foreach my $test (@tests) {
498 my @description = $tests->get_section($test_dir, $test, "description");
499 foreach my $description (@description) {
500 print OUT
" * $description\n";
506 print OUT
"#define WINVER 0x0501\n";
507 print OUT
"#define _WIN32_IE 0x0501\n";
508 print OUT
"#define _WIN32_WINNT 0x0501\n";
510 print OUT
"#define WINE_NOWINSOCK\n";
512 foreach my $test (@tests) {
513 my @includes = $tests->get_section($test_dir, $test, "include");
514 foreach my $include (@includes) {
515 print OUT
"#include $include\n";
519 print OUT
"#include \"wine/test.h\"\n";
522 print OUT
"/***********************************************************************\n";
523 print OUT
" * Compatibility macros\n";
526 print OUT
"#define DWORD_PTR UINT_PTR\n";
527 print OUT
"#define LONG_PTR INT_PTR\n";
528 print OUT
"#define ULONG_PTR UINT_PTR\n";
531 print OUT
"/***********************************************************************\n";
532 print OUT
" * Windows API extension\n";
535 print OUT
"#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n";
536 print OUT
"# define _TYPE_ALIGNMENT(type) __alignof(type)\n";
537 print OUT
"#elif defined(__GNUC__)\n";
538 print OUT
"# define _TYPE_ALIGNMENT(type) __alignof__(type)\n";
541 print OUT
" * FIXME: May not be possible without a compiler extension\n";
542 print OUT
" * (if type is not just a name that is, otherwise the normal\n";
543 print OUT
" * TYPE_ALIGNMENT can be used)\n";
545 print OUT
"#endif\n";
547 print OUT
"#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)\n";
548 print OUT
"#pragma warning(disable:4116)\n";
549 print OUT
"#endif\n";
551 print OUT
"#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)\n";
552 print OUT
"# define TYPE_ALIGNMENT _TYPE_ALIGNMENT\n";
553 print OUT
"#endif\n";
556 print OUT
"/***********************************************************************\n";
557 print OUT
" * Test helper macros\n";
560 print OUT
"#define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);\n";
562 print OUT
"#ifdef TYPE_ALIGNMENT\n";
563 print OUT
"# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);\n";
565 print OUT
"# define TEST_TYPE_ALIGN(type, align)\n";
566 print OUT
"#endif\n";
568 print OUT
"#ifdef _TYPE_ALIGNMENT\n";
569 print OUT
"# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);\n";
570 print OUT
"# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);\n";
572 print OUT
"# define TEST_TARGET_ALIGN(type, align)\n";
573 print OUT
"# define TEST_FIELD_ALIGN(type, field, align)\n";
574 print OUT
"#endif\n";
576 print OUT
"#define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);\n";
578 print OUT
"#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)\n";
579 print OUT
"#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)\n";
580 print OUT
"#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);\n";
581 print OUT
"#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);\n";
586 ########################################################################
589 sub output_footer
($$$) {
592 my $test_dir = shift;
593 my @tests = @
{(shift)};
595 print OUT
"START_TEST(generated)\n";
597 foreach my $test (@tests) {
598 print OUT
" test_$test();\n";
603 ########################################################################
604 # output_test_pack_type
606 sub output_test_pack_type
($$$$$$) {
609 my $type_name2type = shift;
610 my $type_name2optional = shift;
611 my $type_name2optional_fields = shift;
612 my $type_name = shift;
615 my $optional_fields = $$type_name2optional_fields{$type_name};
617 my $type_align = $type->align;
618 my $type_pack = $type->pack;
619 my $type_size = $type->size;
620 my $type_kind = $type->kind;
622 if (defined($type_pack)) {
623 print OUT
" /* $type_name (pack $type_pack) */\n";
625 print OUT
" /* $type_name */\n";
628 if (!scalar(keys(%$optional_fields)) && defined($type_align) && defined($type_size)) {
629 print OUT
" TEST_TYPE_SIZE ($type_name, $type_size)\n";
630 print OUT
" TEST_TYPE_ALIGN ($type_name, $type_align)\n";
633 if ($type_kind eq "float") {
635 } elsif ($type_kind eq "pointer") {
636 my $dereference_type;
637 $dereference_type = sub {
640 my @fields = $type->fields;
641 my $type_name2 =$fields[0]->type_name;
643 if ($type_name2 =~ s/\s*\*$//) {
644 my $type2 = $$type_name2type{$type_name2};
645 if (defined($type2)) {
648 if ($type_name2 !~ /^(?:PVOID|VOID|void)$/) {
649 $output->write("$type_name2: warning: type not found 1\n");
653 } elsif ($type_name2 =~ /^\w+$/) {
654 my $type2 = $$type_name2type{$type_name2};
655 if (defined($type2)) {
656 return &$dereference_type($type2);
658 $output->write("$type_name2: warning: type not found\n");
661 } elsif ($type_name2 =~ /^\w+\s*\((?:\s*CALLBACK|\s*NTAPI|\s*WINAPI)?\s*\*\s*\)\s*\(.*?\)$/) {
664 $output->write("$type_name2: warning: type can't be parsed\n");
669 my $type2 = &$dereference_type($type);
670 if (defined($type2)) {
671 my $type_name2 = $type2->name;
672 my $type_align2 = $type2->align;
673 my $type_size2 = $type2->size;
675 my $optional = $$type_name2optional{$type_name};
676 my $optional_fields2 = $$type_name2optional_fields{$type_name2};
678 if (!$optional && !scalar(keys(%$optional_fields2)) && defined($type_align2) && defined($type_size2)) {
679 print OUT
" TEST_TARGET_SIZE ($type_name, $type_size2)\n";
680 print OUT
" TEST_TARGET_ALIGN($type_name, $type_align2)\n";
682 # $output->write("$type_name: warning: type size not found\n");
685 } elsif ($type_kind eq "signed") {
686 print OUT
" TEST_TYPE_SIGNED($type_name)\n";
687 } elsif ($type_kind eq "unsigned") {
688 print OUT
" TEST_TYPE_UNSIGNED($type_name)\n";
692 sub output_test_pack_fields
($$$$$$$);
693 sub output_test_pack_fields
($$$$$$$) {
696 my $type_name2type = shift;
697 my $type_name2optional = shift;
698 my $type_name2optional_fields = shift;
699 my $type_name = shift;
703 my $optional_fields = $$type_name2optional_fields{$type_name};
705 foreach my $field ($type->fields()) {
706 my $field_type_name = $field->type_name;
707 $field_type_name =~ s/\s+DECLSPEC_ALIGN\(\d+\)//;
708 my $field_name = $field->name;
709 my $field_size = $field->size;
710 my $field_offset = $field->offset;
711 my $field_align = $field->align;
713 next if $field_name eq "" || (defined($field_size) && $field_size < 0);
714 # We cannot take the address of a bitfield with MSVC
715 next if ($field_type_name =~ /:/);
717 if ($$optional_fields{$field_name}) {
719 } elsif (defined($field_size) && defined($field_offset)) {
720 $field_offset += $offset;
721 if ($field_name eq "DUMMYSTRUCTNAME") {
722 print OUT
"#ifdef NONAMELESSSTRUCT\n";
723 print OUT
" TEST_TYPE_SIZE ($type_name.$field_name, $field_size)\n";
724 print OUT
" TEST_FIELD_ALIGN ($type_name, $field_name, $field_align)\n";
725 print OUT
" TEST_FIELD_OFFSET($type_name, $field_name, $field_offset)\n";
727 output_test_pack_fields
(\
*OUT
, $type_name2type, $type_name2optional, $type_name2optional_fields,
728 $type_name, $$type_name2type{$field_type_name}, $field_offset);
729 print OUT
"#endif\n";
731 print OUT
" TEST_FIELD_SIZE ($type_name, $field_name, $field_size)\n";
732 print OUT
" TEST_FIELD_ALIGN ($type_name, $field_name, $field_align)\n";
733 print OUT
" TEST_FIELD_OFFSET($type_name, $field_name, $field_offset)\n";
736 # $output->write("$type_name: $field_type_name: $field_name: test not generated (offset not defined)\n");
741 ########################################################################
744 sub output_test_pack
($$$$) {
747 my $test_dir = shift;
750 my $type_names_used = shift;
752 $output->prefix("$test_dir: $test: ");
754 my @headers = $tests->get_section($test_dir, $test, "header");
755 my @type_names = $tests->get_section($test_dir, $test, "type");
757 my %type_name2optional;
758 my %type_name2optional_fields;
760 foreach my $_type_name (@type_names) {
761 my $type_name = $_type_name;
763 if ($type_name =~ s/^!//) {
764 $type_name2optional{$type_name}++;
767 my $optional_fields = {};
768 if ($type_name =~ s/:\s*(.*?)$//) {
769 my @fields = split /\s+/, $1;
770 foreach my $field (@fields) {
771 if ($field =~ s/^!//) {
772 $$optional_fields{$field}++;
777 $type_name2optional_fields{$type_name} = $optional_fields;
780 foreach my $header (@headers) {
781 my $type_name2type = $file2types{$pointer_size}{"include/$header"};
783 foreach my $_type_name (@type_names) {
784 my $type_name = $_type_name;
786 my $skip = ($type_name =~ s/^!//);
787 $type_name =~ s/:.*?$//;
788 my $type = $$type_name2type{$type_name};
789 if (!defined($type)) {
792 $$type_names_used{$type_name} = $skip ?
-1 : 1;
795 print OUT
"static void test_${test}_$type_name(void)\n";
797 output_test_pack_type
(\
*OUT
, $type_name2type, \
%type_name2optional, \
%type_name2optional_fields,
799 output_test_pack_fields
(\
*OUT
, $type_name2type, \
%type_name2optional, \
%type_name2optional_fields,
800 $type_name, $type, 0);
808 ########################################################################
811 sub output_file
($$$$) {
814 my $test_dir = shift;
815 my @tests = @
{(shift)};
817 my $type_names_used = shift;
819 output_header
(\
*OUT
, $test_dir, \
@tests);
821 foreach my $test (@tests) {
822 my %type_names_used2;
824 if ($test eq "pack") {
825 print OUT
"#ifdef _WIN64\n\n";
827 output_test_pack
(\
*OUT
, $test_dir, $test, \
%type_names_used2);
828 print OUT
"#else /* _WIN64 */\n\n";
830 output_test_pack
(\
*OUT
, $test_dir, $test, \
%type_names_used2);
831 print OUT
"#endif /* _WIN64 */\n\n";
833 die "no such test ($test)\n";
836 print OUT
"static void test_$test(void)\n";
838 foreach my $type_name (sort(keys(%type_names_used2))) {
839 $$type_names_used{$type_name} = $type_names_used2{$type_name};
840 if ($type_names_used2{$type_name} > 0) {
841 print OUT
" test_${test}_$type_name();\n";
848 output_footer
(\
*OUT
, $test_dir, \
@tests);
853 ########################################################################
856 my %type_names_used = ();
858 my @test_dirs = $tests->get_test_dirs();
859 foreach my $test_dir (@test_dirs) {
860 my $file = "$wine_dir/$test_dir/generated.c";
861 replace_file
($file, \
&output_file
, $test_dir, \
@tests, \
%type_names_used);
864 foreach my $header (sort(keys(%{$file2types{$pointer_size}}))) {
865 $output->prefix("$header: ");
866 $header =~ s
%^include
/%%;
867 my $type_name2type = $file2types{$pointer_size}{"include/$header"};
868 foreach my $_type_name (sort(keys(%$type_name2type))) {
869 my $type_name = $_type_name;
871 if (!exists($type_names_used{$type_name})) {
872 $output->write("$type_name: type not used\n");
877 $output->prefix("$winapi_dir/tests.dat: ");
878 foreach my $type_name (sort(keys(%type_names_used))) {
880 foreach my $header (sort(keys(%{$file2types{$pointer_size}}))) {
881 my $type_name2type = $file2types{$pointer_size}{"include/$header"};
882 if (exists($type_name2type{$type_name})) {
888 $output->write("$type_name: type not used\n");