diff options
author | Olivier Thauvin <olivier.thauvin@aerov.jussieu.fr> | 2005-01-28 17:53:11 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-01-30 14:50:15 +0000 |
commit | 9e3b9e5a5d8bea4abb387fc616a73216b4d8c289 (patch) | |
tree | 31ffc0512e556d963a8adc4f325fa4a2ff4e229b /utils | |
parent | 75af1a9c52a124d2be09fece4ba0d7bc6091ed01 (diff) | |
download | perl-9e3b9e5a5d8bea4abb387fc616a73216b4d8c289.tar.gz |
h2hp: 2 fix
Message-Id: <200501281653.15708.olivier.thauvin@aerov.jussieu.fr>
p4raw-id: //depot/perl@23899
Diffstat (limited to 'utils')
-rw-r--r-- | utils/h2ph.PL | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 81e23f6036..8c574c338f 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -276,6 +276,8 @@ while (defined (my $file = next_file())) { chomp $next; # drop "#define FOO FOO" in enums $next =~ s/^\s*#\s*define\s+(\w+)\s+\1\s*$//; + # #defines in enums (aliases) + $next =~ s/^\s*#\s*define\s+(\w+)\s+(\w+)\s*$/$1 = $2,/; $_ .= $next; print OUT "# $next\n" if $opt_D; } @@ -288,6 +290,7 @@ while (defined (my $file = next_file())) { my $enum_val = -1; foreach my $enum (@enum_subs) { my ($enum_name, $enum_value) = $enum =~ /^([a-zA-Z_]\w*)(=.+)?$/; + $enum_name or next; $enum_value =~ s/^=//; $enum_val = (length($enum_value) ? $enum_value : $enum_val + 1); if ($opt_h) { |