classes.struct: fields with a type that's an array of pointers (eg int*[3]) now work
parent
25ea734a8e
commit
d450d12b2b
|
@ -22,16 +22,25 @@ GENERIC: <c-array> ( len c-type -- array )
|
|||
M: word <c-array>
|
||||
c-array-constructor execute( len -- array ) ; inline
|
||||
|
||||
M: pointer <c-array>
|
||||
drop void* <c-array> ;
|
||||
|
||||
GENERIC: (c-array) ( len c-type -- array )
|
||||
|
||||
M: word (c-array)
|
||||
c-(array)-constructor execute( len -- array ) ; inline
|
||||
|
||||
M: pointer (c-array)
|
||||
drop void* (c-array) ;
|
||||
|
||||
GENERIC: <c-direct-array> ( alien len c-type -- array )
|
||||
|
||||
M: word <c-direct-array>
|
||||
c-direct-array-constructor execute( alien len -- array ) ; inline
|
||||
|
||||
M: pointer <c-direct-array>
|
||||
drop void* <c-direct-array> ;
|
||||
|
||||
: malloc-array ( n type -- array )
|
||||
[ heap-size calloc ] [ <c-direct-array> ] 2bi ; inline
|
||||
|
||||
|
|
|
@ -476,3 +476,9 @@ CONSULT: struct-test-delegate struct-test-delegator del>> ;
|
|||
7 >>a
|
||||
8 >>b
|
||||
] unit-test
|
||||
|
||||
SPECIALIZED-ARRAY: void*
|
||||
|
||||
STRUCT: silly-array-field-test { x int*[3] } ;
|
||||
|
||||
[ t ] [ silly-array-field-test <struct> x>> void*-array? ] unit-test
|
||||
|
|
Loading…
Reference in New Issue