'short', 'signed', 'sizeof', 'static', 'struct', 'switch',
'typedef', 'union', 'unsigned', 'void', 'volatile', 'while');
+# Some headers need a bit more attention.
+$mustprepend{'regex.h'} = "#include <sys/types.h>\n";
+
# Make an hash table from this information.
while ($#keywords) {
$iskeyword{pop (@keywords)} = 1;
my($fnamebase) = "$tmpdir/$h-test";
my($missing);
my(@allow) = ();
+ my($prepend) = $mustprepend{$h};
printf ("Testing <$h>\n");
printf ("----------" . "-" x length ($h) . "\n");
# Generate a program to test for the availability of this header.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
close (TESTFILE);
# Generate a program to test for the availability of this member.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
print TESTFILE "$struct a;\n";
print TESTFILE "$struct b;\n";
# Test the types of the members.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
print TESTFILE "$struct a;\n";
print TESTFILE "extern $type b$rest;\n";
# Generate a program to test for the availability of this constant.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
print TESTFILE "__typeof__ ($const) a = $const;\n";
close (TESTFILE);
if ($value ne "") {
# Generate a program to test for the value of this constant.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
print TESTFILE "int main (void) { return $const != $value; }\n";
close (TESTFILE);
# Generate a program to test for the availability of this constant.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
print TESTFILE "$type *a;\n";
close (TESTFILE);
# Generate a program to test for availability of this function.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
# print TESTFILE "#undef $fname\n";
print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
# Generate a program to test for the type of this function.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
# print TESTFILE "#undef $fname\n";
print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
# Generate a program to test for availability of this macro.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
print TESTFILE "#ifndef $macro\n";
print TESTFILE "# error \"Macro $macro not defined\"\n";