From b6b0c908bd088a66cd6efc300e036be01e65cbef Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 8 Mar 2021 13:56:26 +0100 Subject: [PATCH] Dynapi: fix 'gendynapi.pl' script for array parameters --- src/dynapi/gendynapi.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dynapi/gendynapi.pl b/src/dynapi/gendynapi.pl index beb4a359c..dc1d22ca6 100755 --- a/src/dynapi/gendynapi.pl +++ b/src/dynapi/gendynapi.pl @@ -107,13 +107,19 @@ while (my $d = readdir(HEADERS)) { $type =~ s/\s*\*\Z/*/g; $type =~ s/\s*(\*+)\Z/ $1/; #print("SPLIT: ($type, $var)\n"); + my $var_array_suffix = ""; + # parse array suffix + if ($var =~ /\A.*(\[.*\])\Z/) { + #print("PARSED ARRAY SUFFIX: [$1] of '$var'\n"); + $var_array_suffix = $1; + } my $name = chr(ord('a') + $i); if ($i > 0) { $paramstr .= ', '; $argstr .= ','; } my $spc = ($type =~ /\*\Z/) ? '' : ' '; - $paramstr .= "$type$spc$name"; + $paramstr .= "$type$spc$name$var_array_suffix"; $argstr .= "$name"; } $i++;