diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index 6067c90f2d..df5a5bbba8 100755 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -259,8 +259,9 @@ M: long-long-type box-return ( type -- ) [ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ] bi (( value -- c-ptr )) define-inline ; -: c-bool> ( int -- ? ) - 0 = not ; inline +: >c-bool ( ? -- int ) 1 0 ? ; inline + +: c-bool> ( int -- ? ) 0 = not ; inline : define-primitive-type ( type name -- ) [ typedef ] @@ -409,8 +410,8 @@ CONSTANT: primitive-types "uchar" define-primitive-type <c-type> - [ alien-unsigned-1 zero? not ] >>getter - [ [ 1 0 ? ] 2dip set-alien-unsigned-1 ] >>setter + [ alien-unsigned-1 c-bool> ] >>getter + [ [ >c-bool ] 2dip set-alien-unsigned-1 ] >>setter 1 >>size 1 >>align "box_boolean" >>boxer diff --git a/basis/cpu/ppc/ppc.factor b/basis/cpu/ppc/ppc.factor index 442dd8e7ea..314ea830f8 100644 --- a/basis/cpu/ppc/ppc.factor +++ b/basis/cpu/ppc/ppc.factor @@ -713,4 +713,10 @@ USE: vocabs.loader } cond "complex-double" c-type t >>return-in-registers? drop -"bool" c-type 4 >>size 4 >>align drop \ No newline at end of file + +"bool" c-type +4 >>size +4 >>align +[ alien-unsigned-1 c-bool> ] >>getter +[ [ >c-bool ] 2dip set-alien-unsigned-1 ] >>setter +drop \ No newline at end of file