Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…thingy.
  • Loading branch information...
commit a32dace9159009f96c09261d7f7a493411028dfc 1 parent 93c5010
Jonathan Worthington authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/NativeCall.pm
9 lib/NativeCall.pm
View
@@ -1,10 +1,15 @@
+class CPointer { }
+
our sub perl6-sig-to-backend-sig(Signature $siggy) {
my $sig-string = "l"; # XXX Need to handle return types.
my @params = $siggy.params();
for @params -> $p {
given $p.type {
- when Int { $sig-string = $sig-string ~ 'l'; }
- when Str { $sig-string = $sig-string ~ 't'; }
+ when Int { $sig-string = $sig-string ~ 'l' }
+ when Str { $sig-string = $sig-string ~ 't' }
+ when Num { $sig-string = $sig-string ~ 'd' }
+ when Rat { $sig-string = $sig-string ~ 'd' }
+ when CPointer { $sig-string = $sig-string ~ 'P' }
default { die "Can not handle type " ~ $_.perl ~ " in a native signature." }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.