summaryrefslogtreecommitdiff
path: root/utils/h2ph.PL
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-08 01:14:45 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-08 01:14:45 +0000
commitdccff43d435d574843d33f7c32cc7d8d1a628596 (patch)
tree224e240908a389f4fadd884782ad4a7653429779 /utils/h2ph.PL
parentfd3f0affe9994fa8ef40841cc5ca77d231c32c0c (diff)
downloadperl-dccff43d435d574843d33f7c32cc7d8d1a628596.tar.gz
h2ph: more evilness in the form of Linux inline assembler.
p4raw-id: //depot/perl@17078
Diffstat (limited to 'utils/h2ph.PL')
-rw-r--r--utils/h2ph.PL15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index b0b906d1a1..e99df44684 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -108,7 +108,8 @@ while (defined (my $file = next_file())) {
}
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;
@@ -240,7 +241,7 @@ while (defined (my $file = next_file())) {
}
} 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*$//;
@@ -404,6 +405,7 @@ sub expr {
sub next_line
{
+ my $file = shift;
my ($in, $out);
my $pre_sub_tri_graphs = 1;
@@ -433,6 +435,13 @@ sub next_line
}
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;
@@ -458,7 +467,7 @@ sub next_line
} elsif ($in =~ s/^([^\'\"\\\/]+)//) {
$out .= $1;
} else {
- die "Cannot parse:\n$in\n";
+ die "Cannot parse:\n$in\n";
}
}