develooper Front page | perl.perl5.porters | Postings from May 2004

[PATCH] Re: [perl #29969] h2ph not correctly processing glibc sys/sysmacros.ph

Thread Next
From:
wolfgang.laun
Date:
May 30, 2004 14:55
Subject:
[PATCH] Re: [perl #29969] h2ph not correctly processing glibc sys/sysmacros.ph
Message ID:
20040530152707.ZLWL22856.viefep16-int.chello.at@localhost
At 30 May 2004 02:51:10 -0000 Sam Vilain wrote:
>
> h2ph sys/sysmacros.h incorrectly translates this:
> 
> #  define makedev(major, minor) { ((((unsigned int) (major)) << 8) \
>                                    | ((unsigned int) (minor))), 0 }
[snip]
> Any ideas?

Yes.

--- h2ph.old	Sat Jan 17 09:38:29 2004
+++ h2ph	Sun May 30 16:57:41 2004
@@ -346,10 +346,16 @@
         };
 	# Eliminate typedefs
 	/\(([\w\s]+)[\*\s]*\)\s*[\w\(]/ && do {
+	    my $doit = 1;
 	    foreach (split /\s+/, $1) {  # Make sure all the words are types,
-		last unless ($isatype{$_} or $_ eq 'struct' or $_ eq 'union');
+	        unless($isatype{$_} or $_ eq 'struct' or $_ eq 'union'){
+		    $doit = 0;
+		    last;
+		}
+	    }
+	    if( $doit ){
+		s/\([\w\s]+[\*\s]*\)// && next;      # then eliminate them.
 	    }
-	    s/\([\w\s]+[\*\s]*\)// && next;      # then eliminate them.
 	};
 	# struct/union member, including arrays:
 	s/^([_A-Z]\w*(\[[^\]]+\])?((\.|->)[_A-Z]\w*(\[[^\]]+\])?)+)//i && do {



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About