Fix bool type on PowerPC
parent
c32927bfea
commit
9986f6e23e
basis
alien/c-types
cpu/ppc
|
@ -259,8 +259,9 @@ M: long-long-type box-return ( type -- )
|
||||||
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ] bi
|
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ] bi
|
||||||
(( value -- c-ptr )) define-inline ;
|
(( value -- c-ptr )) define-inline ;
|
||||||
|
|
||||||
: c-bool> ( int -- ? )
|
: >c-bool ( ? -- int ) 1 0 ? ; inline
|
||||||
0 = not ; inline
|
|
||||||
|
: c-bool> ( int -- ? ) 0 = not ; inline
|
||||||
|
|
||||||
: define-primitive-type ( type name -- )
|
: define-primitive-type ( type name -- )
|
||||||
[ typedef ]
|
[ typedef ]
|
||||||
|
@ -409,8 +410,8 @@ CONSTANT: primitive-types
|
||||||
"uchar" define-primitive-type
|
"uchar" define-primitive-type
|
||||||
|
|
||||||
<c-type>
|
<c-type>
|
||||||
[ alien-unsigned-1 zero? not ] >>getter
|
[ alien-unsigned-1 c-bool> ] >>getter
|
||||||
[ [ 1 0 ? ] 2dip set-alien-unsigned-1 ] >>setter
|
[ [ >c-bool ] 2dip set-alien-unsigned-1 ] >>setter
|
||||||
1 >>size
|
1 >>size
|
||||||
1 >>align
|
1 >>align
|
||||||
"box_boolean" >>boxer
|
"box_boolean" >>boxer
|
||||||
|
|
|
@ -713,4 +713,10 @@ USE: vocabs.loader
|
||||||
} cond
|
} cond
|
||||||
|
|
||||||
"complex-double" c-type t >>return-in-registers? drop
|
"complex-double" c-type t >>return-in-registers? drop
|
||||||
"bool" c-type 4 >>size 4 >>align drop
|
|
||||||
|
"bool" c-type
|
||||||
|
4 >>size
|
||||||
|
4 >>align
|
||||||
|
[ alien-unsigned-1 c-bool> ] >>getter
|
||||||
|
[ [ >c-bool ] 2dip set-alien-unsigned-1 ] >>setter
|
||||||
|
drop
|
Loading…
Reference in New Issue