[inseparable changes from patch to perl 5.004_04]
[p5sagit/p5-mst-13.2.git] / utils / h2ph.PL
index d48571f..1b469da 100644 (file)
@@ -50,7 +50,7 @@ die "Destination directory $Dest_dir doesn't exist or isn't a directory\n"
        short   ushort  u_short
        int     uint    u_int
        long    ulong   u_long
-       FILE
+       FILE    key_t   caddr_t
 END
 
 @isatype{@isatype} = (1) x @isatype;
@@ -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";
                    }
                }
            }
@@ -191,9 +191,10 @@ exit $Exit;
 
 sub expr {
     while ($_ ne '') {
+       s/^\&//;                # hack for things that take the address of
        s/^(\s+)//              && do {$new .= ' '; next;};
        s/^(0x[0-9a-fA-F]+)//   && do {$new .= $1; next;};
-       s/^(\d+)[LlUu]*//       && do {$new .= $1; next;};
+       s/^(\d+)\s*[LlUu]*//    && do {$new .= $1; next;};
        s/^("(\\"|[^"])*")//    && do {$new .= $1; next;};
        s/^'((\\"|[^"])*)'//    && do {
            if ($curargs{$1}) {