diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index 7bcb59997d..7f66417a55 100644 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -189,15 +189,19 @@ CONSTANT: primitive-types c-string } -: (pointer-c-type) ( void* type -- void*' ) - [ clone ] dip c-type-boxer-quot '[ _ [ f ] if* ] >>boxer-quot ; - : >c-bool ( ? -- int ) 1 0 ? ; inline : c-bool> ( int -- ? ) 0 = not ; inline >align 8 >>align-first ] } + { [ cpu x86.32? os windows? not and ] [ 4 >>align 4 >>align-first ] } + [ 8 >>align 8 >>align-first ] + } cond ; + : resolve-pointer-typedef ( type -- base-type ) dup "c-type" word-prop dup word? [ nip resolve-pointer-typedef ] [ @@ -209,19 +213,15 @@ CONSTANT: primitive-types resolve-pointer-typedef [ void? ] [ primitive-types member? ] bi or ] [ drop t ] if ; +: (pointer-c-type) ( void* type -- void*' ) + [ clone ] dip c-type-boxer-quot '[ _ [ f ] if* ] >>boxer-quot ; + PRIVATE> M: pointer c-type [ \ void* c-type ] dip to>> dup primitive-pointer-type? [ drop ] [ (pointer-c-type) ] if ; -: 8-byte-alignment ( c-type -- c-type ) - { - { [ cpu ppc? os macosx? and ] [ 4 >>align 8 >>align-first ] } - { [ cpu x86.32? os windows? not and ] [ 4 >>align 4 >>align-first ] } - [ 8 >>align 8 >>align-first ] - } cond ; - [ c-ptr >>class