Permalink
Browse files

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

…thingy.
  • Loading branch information...
1 parent 93c5010 commit a32dace9159009f96c09261d7f7a493411028dfc @jnthn committed Mar 2, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/NativeCall.pm
View
9 lib/NativeCall.pm
@@ -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." }
}
}

0 comments on commit a32dace

Please sign in to comment.