M: long-long-type unbox-parameter unbox ;
-M: struct-c-type unbox-parameter frob-struct unbox ;
+M: struct-c-type unbox-parameter
+ dup value-struct? [ unbox ] [
+ [ nip heap-size f ^^local-allot dup ]
+ [ [ ^^unbox-any-c-ptr ] dip explode-struct keys ] 2bi
+ implode-struct
+ 1array { { int-rep f } }
+ ] if ;
GENERIC: unbox-return ( src c-type -- )
M: long-long-type box-parameter box ;
-M: struct-c-type box-parameter frob-struct box ;
+M: struct-c-type box-parameter
+ dup value-struct?
+ [ [ [ drop first ] dip explode-struct keys ] keep ] unless
+ box ;
GENERIC: box-return ( c-type -- dst )
math memory namespaces namespaces.private parser
quotations sequences specialized-arrays stack-checker
stack-checker.errors system threads tools.test words
-alien.complex concurrency.promises alien.data ;
+alien.complex concurrency.promises alien.data
+byte-arrays classes ;
FROM: alien.c-types => float short ;
SPECIALIZED-ARRAY: float
SPECIALIZED-ARRAY: char
void { void* void* double-rect } cdecl alien-indirect
"example" get-global ;
-[ 1.0 2.0 3.0 4.0 ]
+[ byte-array 1.0 2.0 3.0 4.0 ]
[
1.0 2.0 3.0 4.0 <double-rect>
double-rect-callback double-rect-test
- >double-rect<
+ [ >c-ptr class ] [ >double-rect< ] bi
] unit-test
STRUCT: test_struct_14