summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters.nicoh.com>1996-01-02 03:13:31 +0000
committerAndy Dougherty <doughera.lafayette.edu>1996-01-02 03:13:31 +0000
commitfb21d8eb4a487103913cd3dea3c85ca719966467 (patch)
treef091aa06ff0d713685d0187d82463afcafa5fc9a /utils
parent9aec1e06323f04fc8a0ba5b398f709df6957228e (diff)
downloadperl-fb21d8eb4a487103913cd3dea3c85ca719966467.tar.gz
perl 5.002beta1h patch: utils/h2ph.PL
Add patch for AIX files which sometimes have #include<foo.h>, i.e., no spaces after the word 'include'.
Diffstat (limited to 'utils')
-rw-r--r--utils/h2ph.PL12
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 58ef8d500e..4e0dbd1910 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -132,7 +132,7 @@ foreach $file (@ARGV) {
}
}
}
- elsif (/^include\s+<(.*)>/) {
+ elsif (/^include\s*<(.*)>/) {
($incl = $1) =~ s/\.h$/.ph/;
print OUT $t,"require '$incl';\n";
}
@@ -198,7 +198,7 @@ sub expr {
}
next;
};
- s/^sizeof\s*\(([^)]+)\)/{$1}/ && do {
+ s/^sizeof\s*\(([^)]+\))\)/{$1}/ && do {
$new .= '$sizeof';
next;
};
@@ -239,13 +239,17 @@ sub expr {
else {
if ($inif && $new !~ /defined\($/) {
$new .= '(defined(&' . $id . ') ? &' . $id . ' : 0)';
- } else {
+ }
+ elsif (/^\[/) {
+ $new .= ' $' . $id;
+ }
+ else {
$new .= ' &' . $id;
}
}
next;
};
- s/^(.)// && do {$new .= $1; next;};
+ s/^(.)// && do { if ($1 ne '#') { $new .= $1; } next;};
}
}
##############################################################################