mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
changes intended to allow use of _Bool throughout
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39010 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1d6a599be7
commit
0c5d96eebd
17 changed files with 291 additions and 40 deletions
|
@ -1090,23 +1090,23 @@ GSObjCGetVal(NSObject *self, const char *key, SEL sel,
|
|||
}
|
||||
break;
|
||||
|
||||
#if defined(_C_BOOL)
|
||||
#if __GNUC__ != 2
|
||||
case _C_BOOL:
|
||||
{
|
||||
bool v;
|
||||
_Bool v;
|
||||
|
||||
if (sel == 0)
|
||||
{
|
||||
v = *(bool *)((char *)self + offset);
|
||||
v = *(_Bool *)((char *)self + offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool (*imp)(id, SEL) =
|
||||
(bool (*)(id, SEL))[self methodForSelector: sel];
|
||||
_Bool (*imp)(id, SEL) =
|
||||
(_Bool (*)(id, SEL))[self methodForSelector: sel];
|
||||
|
||||
v = (*imp)(self, sel);
|
||||
}
|
||||
val = [NSNumber numberWithBool: v];
|
||||
val = [NSNumber numberWithBool: (BOOL)v];
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -1555,21 +1555,21 @@ GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,
|
|||
}
|
||||
break;
|
||||
|
||||
#if defined(_C_BOOL)
|
||||
#if __GNUC__ != 2
|
||||
case _C_BOOL:
|
||||
{
|
||||
bool v = [val boolValue];
|
||||
_Bool v = (_Bool)[val boolValue];
|
||||
|
||||
if (sel == 0)
|
||||
{
|
||||
bool *ptr = (bool*)((char *)self + offset);
|
||||
_Bool *ptr = (_Bool*)((char *)self + offset);
|
||||
|
||||
*ptr = v;
|
||||
}
|
||||
else
|
||||
{
|
||||
void (*imp)(id, SEL, bool) =
|
||||
(void (*)(id, SEL, bool))[self methodForSelector: sel];
|
||||
void (*imp)(id, SEL, _Bool) =
|
||||
(void (*)(id, SEL, _Bool))[self methodForSelector: sel];
|
||||
|
||||
(*imp)(self, sel, v);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue