windows.directx.dinput: pre-construct some intermediate structs to slightly improve horrible compilation time on the gigantic macro expansions

db4
Joe Groff 2010-05-02 18:14:30 -07:00
parent 515296892b
commit c167646e3b
1 changed files with 4 additions and 2 deletions

View File

@ -48,13 +48,15 @@ M: array array-base-type first ;
: <DIOBJECTDATAFORMAT>-quot ( struct {pguid-var,field,index,dwType-flags,dwFlags} -- quot ) : <DIOBJECTDATAFORMAT>-quot ( struct {pguid-var,field,index,dwType-flags,dwFlags} -- quot )
{ {
[ first dup word? [ '[ _ get ] ] [ drop [ f ] ] if ] [ drop f ]
[ second rot [ (offsetof) ] [ (sizeof) ] 2bi ] [ second rot [ (offsetof) ] [ (sizeof) ] 2bi ]
[ third * + ] [ third * + ]
[ fourth (flags) ] [ fourth (flags) ]
[ 4 swap nth (flag) ] [ 4 swap nth (flag) ]
[ first dup word? [ '[ _ get ] ] [ drop [ f ] ] if ]
} cleave } cleave
'[ @ _ _ _ DIOBJECTDATAFORMAT <struct-boa> ] ; [ DIOBJECTDATAFORMAT <struct-boa> ] dip
'[ _ clone @ >>pguid ] ;
:: make-DIOBJECTDATAFORMAT-array-quot ( struct array -- quot ) :: make-DIOBJECTDATAFORMAT-array-quot ( struct array -- quot )
array length '[ _ malloc-DIOBJECTDATAFORMAT-array ] array length '[ _ malloc-DIOBJECTDATAFORMAT-array ]