Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
export longlong, remove spurious comment and fix typo
  • Loading branch information
FROGGS committed Feb 23, 2015
1 parent 1d9aee5 commit ad88cf9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/NativeCall.pm
Expand Up @@ -65,11 +65,10 @@ sub return_hash_for(Signature $s, &r?, :$with-typeobj) {
$result
}

my native long is Int is ctype("long") is repr("P6int") is export(:types, :DEFAULT) { };
#~ my native longlong is Int is ctype("longlong") is repr("P6int") is export(:types, :DEFAULT) { };
#~ my native longdouble is Int is ctype("longdouble") is repr("P6num") is export(:types, :DEFAULT) { };
my class void is repr('CPointer') is export(:types, :DEFAULT) { };
my class Pointer is repr('CPointer') is export(:types, :DEFAULT) { };
my native long is Int is ctype("long") is repr("P6int") is export(:types, :DEFAULT) { };
my native longlong is Int is ctype("longlong") is repr("P6int") is export(:types, :DEFAULT) { };
my class void is repr('CPointer') is export(:types, :DEFAULT) { };
my class Pointer is repr('CPointer') is export(:types, :DEFAULT) { };

# need to introduce the roles in there in an augment, because you can't
# inherit from types that haven't been properly composed.
Expand All @@ -80,7 +79,7 @@ augment class Pointer {
method deref(::?CLASS:D \ptr:) { nativecast(::TValue, ptr) }
}
multi method PARAMETERIZE_TYPE(Mu:U \t) {
die "A types pointer can only hold integers, numbers, strings, CStructs, CPointers or CArrays (not {t.^name})"
die "A typed pointer can only hold integers, numbers, strings, CStructs, CPointers or CArrays (not {t.^name})"
unless t ~~ Int || t ~~ Num || t === Str || t.REPR eq 'CStruct' | 'CUnion' | 'CPPStruct' | 'CPointer' | 'CArray';
my \typed := TypedPointer[t];
typed.HOW.make_pun(typed);
Expand Down

0 comments on commit ad88cf9

Please sign in to comment.