}
print OUT "require '_h2ph_pre.ph';\n\n";
- while (defined (local $_ = next_line())) {
+
+ while (defined (local $_ = next_line($file))) {
if (s/^\s*\#\s*//) {
if (s/^define\s+(\w+)//) {
$name = $1;
}
} elsif(/^\s*(typedef\s*)?enum\s*(\s+[a-zA-Z_]\w*\s*)?/) {
until(/\{[^}]*\}.*;/ || /;/) {
- last unless defined ($next = next_line());
+ last unless defined ($next = next_line($file));
chomp $next;
# drop "#define FOO FOO" in enums
$next =~ s/^\s*#\s*define\s+(\w+)\s+\1\s*$//;
sub next_line
{
+ my $file = shift;
my ($in, $out);
my $pre_sub_tri_graphs = 1;
}
next READ;
}
+ if ($in =~ /^extern inline / &&
+ $^O eq 'linux' && $file =~ m!(?:^|/)asm/[^/]+\.h$!) {
+ while (<IN>) {
+ last if /^}/;
+ }
+ next READ;
+ }
if ($in =~ s/\\$//) { # \-newline
$out .= ' ';
next READ;
} elsif ($in =~ s/^([^\'\"\\\/]+)//) {
$out .= $1;
} else {
- die "Cannot parse:\n$in\n";
+ die "Cannot parse:\n$in\n";
}
}