Make alien.c-types reloadable

db4
Slava Pestov 2008-01-12 17:34:26 -05:00
parent 4373cb1630
commit cece726e54
1 changed files with 110 additions and 105 deletions

View File

@ -3,7 +3,7 @@
USING: byte-arrays arrays generator.registers assocs
kernel kernel.private libc math namespaces parser sequences
strings words assocs splitting math.parser cpu.architecture
alien quotations system ;
alien quotations system compiler.units ;
IN: alien.c-types
TUPLE: c-type
@ -227,10 +227,14 @@ M: long-long-type box-return ( type -- )
define-out ;
: expand-constants ( c-type -- c-type' )
#! We use word-def call instead of execute to get around
#! staging violations
dup array? [
unclip >r [ dup word? [ execute ] when ] map r> add*
unclip >r [ dup word? [ word-def call ] when ] map
r> add*
] when ;
[
[ alien-cell ]
[ set-alien-cell ]
bootstrap-cell
@ -354,3 +358,4 @@ bootstrap-cell
"ushort*" define-primitive-type
[ string>u16-alien ] "ushort*" c-type set-c-type-prep
] with-compilation-unit