 : struct-align ( slots -- align )
     [ class>> c-type-align ] [ max ] map-reduce ;
 
-M: struct-class c-type ;
+M: struct-class c-type
+    name>> c-type ;
 
 M: struct-class c-type-align
     "struct-align" word-prop ;

! (c)Joe Groff bsd license
USING: accessors alien alien.c-types byte-arrays classes
classes.c-types classes.parser classes.tuple
classes.tuple.parser classes.tuple.private combinators
combinators.smart fry generalizations generic.parser kernel
kernel.private libc macros make math math.order parser

    [ class>> c-type drop ] each ;

: (define-struct-class) ( class slots offsets-quot -- )
    [ drop struct f define-tuple-class ] swap
    '[
        make-slots dup
        [ check-struct-slots ] _ [ struct-align [ align ] keep ] tri
        (struct-word-props)
    ]
    [ drop define-struct-for-class ] 2tri ; inline

: define-struct-class ( class slots -- )
    [ struct-offsets ] (define-struct-class) ;
