Skip to content
This repository
Browse code

More types, plus CPointer that translates to some abstract pointer-y …

…thingy.
  • Loading branch information...
commit a32dace9159009f96c09261d7f7a493411028dfc 1 parent 93c5010
Jonathan Worthington authored

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +7 2 lib/NativeCall.pm
9 lib/NativeCall.pm
... ... @@ -1,10 +1,15 @@
  1 +class CPointer { }
  2 +
1 3 our sub perl6-sig-to-backend-sig(Signature $siggy) {
2 4 my $sig-string = "l"; # XXX Need to handle return types.
3 5 my @params = $siggy.params();
4 6 for @params -> $p {
5 7 given $p.type {
6   - when Int { $sig-string = $sig-string ~ 'l'; }
7   - when Str { $sig-string = $sig-string ~ 't'; }
  8 + when Int { $sig-string = $sig-string ~ 'l' }
  9 + when Str { $sig-string = $sig-string ~ 't' }
  10 + when Num { $sig-string = $sig-string ~ 'd' }
  11 + when Rat { $sig-string = $sig-string ~ 'd' }
  12 + when CPointer { $sig-string = $sig-string ~ 'P' }
8 13 default { die "Can not handle type " ~ $_.perl ~ " in a native signature." }
9 14 }
10 15 }

0 comments on commit a32dace

Please sign in to comment.
Something went wrong with that request. Please try again.