Skip to content

Commit

Permalink
[master] storage class problem in dale-autowrap (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhrr committed Jan 17, 2017
1 parent fcc1b1d commit 50d2fff
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion eg/dale-autowrap/dale-autowrap.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
'unsigned-long-long' => '(ulong-long-type)',
);

my %SCMAP = (
'static' => 'intern',
'none' => 'extern-c',
'extern' => 'extern-c',
);

sub type_to_string
{
my ($type) = @_;
Expand Down Expand Up @@ -43,6 +49,11 @@ sub type_to_string
return $tag;
}

sub storage_class_to_string
{
return $SCMAP{$_[0]};
}

sub process_function
{
my ($data) = @_;
Expand All @@ -57,7 +68,8 @@ sub process_function

sprintf("(def %s (fn %s %s %s))",
$data->{'name'},
$data->{'storage_class'},
storage_class_to_string($data->{'storage_class'}
|| $data->{'storage-class'}),
type_to_string($data->{'return-type'}),
$param_str);
}
Expand Down

0 comments on commit 50d2fff

Please sign in to comment.