From: Kurt D. Starsinic Date: Tue, 19 Aug 1997 21:43:32 +0000 (+1200) Subject: h2ph broken in 5.004_02 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4a8e146e38ec2045f1f817a7cb578e1b1f80f39f;p=p5sagit%2Fp5-mst-13.2.git h2ph broken in 5.004_02 > The h2ph in perl5.00402 generates perl code that the interpeter > chokes on. For example, running h2ph on /usr/include/sys/errno.h > (under openbsd) transforms this: > > #define EPERM 1 /* Operation not permitted */ > > into this: > > unless(defined(&EPERM) { > sub EPERM () {1;} > } > > which in turn causes this: > > syntax error at - line 2, near "sub EPERM ()" > > I'm not exactly sure why h2ph is worried about avoiding redefinition . . . It's not a redefinition problem; errno.ph is missing a right paren. Here is a patch, tested against 5.004_02: Credited: David Mazieres p5p-msgid: 199708201700.KAA02621@www.chapin.edu --- diff --git a/utils/h2ph.PL b/utils/h2ph.PL index d48571f..7c36f21 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -132,7 +132,7 @@ foreach $file (@ARGV) { print OUT $t,"eval 'sub $name () {",$new,";}' unless defined(\&$name);\n"; } else { - print OUT $t,"unless(defined(\&$name) {\nsub $name () {",$new,";}\n}\n"; + print OUT $t,"unless(defined(\&$name)) {\nsub $name () {",$new,";}\n}\n"; } } }