Skip to content

Commit

Permalink
[meta] Check global functions return type (opencomputeproject#2115)
Browse files Browse the repository at this point in the history
Make sure it's always expected sai type

Signed-off-by: Baorong Liu <[email protected]>
  • Loading branch information
kcudnik authored and baorliu committed Dec 12, 2024
1 parent 91ef792 commit f9f155b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions meta/parse.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,9 @@ sub ProcessFunctionSection

$type = $1 if $def =~ /^(\w+) sai_\w+$/;

LogError "function $name return type should be sai_(status|object_type|object_id)_t, but is $type"
if not $type =~ /^sai_(status|object_type|object_id)_t$/;

$GLOBAL_APIS{$name}{name} = $name;
$GLOBAL_APIS{$name}{args} = $memberdef->{argsstring}[0];
$GLOBAL_APIS{$name}{type} = $type;
Expand Down

0 comments on commit f9f155b

Please sign in to comment.