 
 [ 1111 f 123456789 ffi_test_22 ] must-fail
 
-C-STRUCT: rect
-    { "float" "x" }
-    { "float" "y" }
-    { "float" "w" }
-    { "float" "h" }
-;
-
-: <rect> ( x y w h -- rect )
-    "rect" <c-object>
-    [ set-rect-h ] keep
-    [ set-rect-w ] keep
-    [ set-rect-y ] keep
-    [ set-rect-x ] keep ;
-
-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
+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
 

] unit-test

! Reported by jedahu
C-STRUCT: bool-field-test
   { "char*" "name" }
   { "bool"  "on" }
   { "short" "parents" } ;

FUNCTION: short ffi_test_48 ( bool-field-test x ) ;

[ 123 ] [
    "bool-field-test" <c-object> 123 over set-bool-field-test-parents
    ffi_test_48
] unit-test

[ 1.0 2.0 3.0 4.0 ]
[ 1.0 2.0 3.0 4.0 <double-rect> double-rect-test >double-rect< ] unit-test

STRUCT: test_struct_14
    { x1 float }
    { x2 float } ;

FUNCTION: test_struct_14 ffi_test_40 ( double x1, double x2 ) ;

[ 1.0 2.0 ] [
    1.0 2.0 ffi_test_40 [ x1>> ] [ x2>> ] bi
] unit-test

: callback-10 ( -- callback )
    "test_struct_14" { "double" "double" } "cdecl"
    [
        test_struct_14 <struct>
            swap >>x2
            swap >>x1
    ] alien-callback ;

: callback-10-test ( x1 x2 callback -- result )
