Skip to content

Commit b6b0c90

Browse files
committed
Dynapi: fix 'gendynapi.pl' script for array parameters
1 parent a793810 commit b6b0c90

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/dynapi/gendynapi.pl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,19 @@
107107
$type =~ s/\s*\*\Z/*/g;
108108
$type =~ s/\s*(\*+)\Z/ $1/;
109109
#print("SPLIT: ($type, $var)\n");
110+
my $var_array_suffix = "";
111+
# parse array suffix
112+
if ($var =~ /\A.*(\[.*\])\Z/) {
113+
#print("PARSED ARRAY SUFFIX: [$1] of '$var'\n");
114+
$var_array_suffix = $1;
115+
}
110116
my $name = chr(ord('a') + $i);
111117
if ($i > 0) {
112118
$paramstr .= ', ';
113119
$argstr .= ',';
114120
}
115121
my $spc = ($type =~ /\*\Z/) ? '' : ' ';
116-
$paramstr .= "$type$spc$name";
122+
$paramstr .= "$type$spc$name$var_array_suffix";
117123
$argstr .= "$name";
118124
}
119125
$i++;

0 commit comments

Comments
 (0)