Re: [perl #29969] h2ph not correctly processing glibc sys/sysmacros.ph
wolfgang.laun@chello.at [Sun, 30 May 2004 17:27:07 +0000 (19:27 +0200)]
Message-Id: <20040530152707.ZLWL22856.viefep16-int.chello.at@localhost>

p4raw-id: //depot/perl@22877

utils/h2ph.PL

index eaa019a..c5cc185 100644 (file)
@@ -380,10 +380,16 @@ sub expr {
         };
        # 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 {