 ] unit-test
 
 ! Reported by jedahu
-C-STRUCT: bool-field-test
-   { "char*" "name" }
-   { "bool"  "on" }
-   { "short" "parents" } ;
+STRUCT: bool-field-test
+    { name pinned-c-ptr }
+    { on boolean }
+    { parents short } ;
 
 FUNCTION: short ffi_test_48 ( bool-field-test x ) ;
 
 [ 123 ] [
-    "bool-field-test" <c-object> 123 over set-bool-field-test-parents
+    bool-field-test <struct>
+        123 >>parents
     ffi_test_48
 ] unit-test


[ 25 ] [ 2 3 4 5 ffi_test_18 ] unit-test

: ffi_test_19 ( x y z -- bar )
    "bar" "f-stdcall" "ffi_test_19" { "long" "long" "long" }
    alien-invoke gc ;

[ 11 6 -7 ] [
    11 6 -7 ffi_test_19 dup bar-x over bar-y rot bar-z
] unit-test

FUNCTION: double ffi_test_6 float x float y ;


[ 1111 f 123456789 ffi_test_22 ] must-fail

STRUCT: RECT
    { x single-float } { y single-float }
    { w single-float } { h single-float } ;

: <RECT> ( x y w h -- rect )
    RECT <struct>
        swap >>h
        swap >>w
        swap >>y
        swap >>x ;

FUNCTION: int ffi_test_12 int a int b RECT c int d int e int f ;

[ 45 ] [ 1 2 3.0 4.0 5.0 6.0 <RECT> 7 8 9 ffi_test_12 ] unit-test

[ 1 2 { 1 2 3 } 7 8 9 ffi_test_12 ] must-fail

