alien.inline.types: replaced const-type? with const-pointer? and pointer-to-const?
parent
03d4575b90
commit
bc6e5de911
|
@ -8,13 +8,16 @@ IN: alien.inline.types
|
|||
: factorize-type ( str -- str' )
|
||||
"const-" ?head drop
|
||||
"unsigned-" ?head [ "u" prepend ] when
|
||||
"long-" ?head [ "long" prepend ] when ;
|
||||
"long-" ?head [ "long" prepend ] when
|
||||
"-const" ?tail drop ;
|
||||
|
||||
: cify-type ( str -- str' )
|
||||
{ { CHAR: - CHAR: space } } substitute ;
|
||||
|
||||
: const-type? ( str -- ? )
|
||||
"const-" head? ;
|
||||
: const-pointer? ( str -- ? )
|
||||
{ [ "-const" tail? ] [ "&" tail? ] } 1|| ;
|
||||
|
||||
: pointer-to-const? ( str -- ? ) "const-" head? ;
|
||||
|
||||
MEMO: resolved-primitives ( -- seq )
|
||||
primitive-types [ resolve-typedef ] map ;
|
||||
|
|
|
@ -278,7 +278,7 @@ M: struct-wrapper dynamic-cast ;
|
|||
|
||||
: out-arg-unmarshaller ( type -- quot )
|
||||
dup {
|
||||
[ const-type? not ]
|
||||
[ pointer-to-const? not ]
|
||||
[ factorize-type pointer-to-primitive? ]
|
||||
} 1&&
|
||||
[ factorize-type primitive-unmarshaller ]
|
||||
|
|
Loading…
Reference in New Issue