Closed p5pRT closed 21 years ago
h2ph.PL mishandles the unions and causes wrong output produced for contructs like: #define DVD_READ_STRUCT _IOWR('d'\, 0\, union dvd_struct)
this was originally reported in openbsd pr/1918 (see http://cvs.openbsd.org/cgi-bin/wwwgnats.pl)
this diff seems to fix it:
RCS file: /cvs/src/gnu/usr.bin/perl/utils/h2ph.PL\,v retrieving revision 1.9 diff -u -r1.9 h2ph.PL --- utils/h2ph.PL 2001/05/24 18:36:26 1.9 +++ utils/h2ph.PL 2001/07/10 17:57:14 @@ -351\,7 +351\,7 @@ # Eliminate typedefs /\(([\w\s]+)[\*\s]*\)\s*[\w\(]/ && do { foreach (split /\s+/\, $1) { # Make sure all the words are types\, - last unless ($isatype{$_} or $_ eq 'struct'); + last unless ($isatype{$_} or $_ eq 'struct' or $_ eq 'union'); } s/\([\w\s]+[\*\s]*\)// && next; # then eliminate them. }; @@ -374\,7 +374\,7 @@ }; s/^([_a-zA-Z]\w*)// && do { my $id = $1; - if ($id eq 'struct') { + if ($id eq 'struct' || $id eq 'union') { s/^\s+(\w+)//; $id .= ' ' . $1; $isatype{$id} = 1;
This patch got into Perl 5.8.0\, I'm therefore marking the problem ticket as resolved.
@jhi - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#7257 (status was 'resolved')
Searchable as RT7257$