From: Perl 5 Porters Date: Tue, 2 Jan 1996 03:13:31 +0000 (+0000) Subject: perl 5.002beta1h patch: utils/h2ph.PL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb21d8eb4a487103913cd3dea3c85ca719966467;p=p5sagit%2Fp5-mst-13.2.git perl 5.002beta1h patch: utils/h2ph.PL Add patch for AIX files which sometimes have #include, i.e., no spaces after the word 'include'. --- diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 58ef8d5..4e0dbd1 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;}; } } ##############################################################################