summaryrefslogtreecommitdiff
path: root/utils/h2xs.PL
diff options
context:
space:
mode:
Diffstat (limited to 'utils/h2xs.PL')
-rw-r--r--utils/h2xs.PL4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index ceac64ee31..b973705ed0 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -901,8 +901,8 @@ if( @path_h ){
next if $opt_e && $enum_name =~ /$opt_e/;
my $val = 0;
for my $item (split /,/, $enum_body) {
- my ($key, $declared_val) = $item =~ /(\w+)\s*=\s*(.*)/;
- $val = length($declared_val) ? $declared_val : 1 + $val;
+ my ($key, $declared_val) = $item =~ /(\w+)\s*(?:=\s*(.*))?/;
+ $val = defined($declared_val) && length($declared_val) ? $declared_val : 1 + $val;
$seen_define{$key} = $declared_val;
$const_names{$key}++;
}