fixup for old runtime

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39041 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-10-08 09:04:48 +00:00
parent e8f8da0618
commit f6271e8e48
14 changed files with 40 additions and 26 deletions

View file

@ -1090,8 +1090,7 @@ GSObjCGetVal(NSObject *self, const char *key, SEL sel,
}
break;
#if __GNUC__ != 2
#ifdef _C_BOOL
#if __GNUC__ != 2 && defined(_C_BOOL)
case _C_BOOL:
{
_Bool v;
@ -1110,7 +1109,6 @@ GSObjCGetVal(NSObject *self, const char *key, SEL sel,
val = [NSNumber numberWithBool: (BOOL)v];
}
break;
#endif
#endif
case _C_SHT:
@ -1557,8 +1555,7 @@ GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,
}
break;
#if __GNUC__ != 2
#ifdef _C_BOOL
#if __GNUC__ != 2 && defined(_C_BOOL)
case _C_BOOL:
{
_Bool v = (_Bool)[val boolValue];
@ -1578,7 +1575,6 @@ GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,
}
}
break;
#endif
#endif
case _C_SHT:

View file

@ -425,7 +425,7 @@ gs_sel_type_to_callback_type (const char *sel_type,
case _C_DBL:
vatype->type = __VAdouble;
break;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
vatype->type = __VAuchar;
break;
@ -614,7 +614,7 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
CASE_TYPE(_C_ULNG_LNG, unsigned long long, av_start_ulonglong)
CASE_TYPE(_C_FLT, float, av_start_float)
CASE_TYPE(_C_DBL, double, av_start_double)
#if __GNUC__ != 2
#ifdef _C_BOOL
CASE_TYPE(_C_BOOL, _Bool, av_start_uchar)
#endif
@ -719,7 +719,7 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
CASE_TYPE(_C_ULNG_LNG, unsigned long long, av_ulonglong)
CASE_TYPE(_C_FLT, float, av_float)
CASE_TYPE(_C_DBL, double, av_double)
#if __GNUC__ != 2
#ifdef _C_BOOL
CASE_TYPE(_C_BOOL, _Bool, av_uchar)
#endif
@ -1057,7 +1057,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
CASE_TYPE(_C_ULNG_LNG, unsigned long long, va_arg_ulonglong)
CASE_TYPE(_C_FLT, float, va_arg_float)
CASE_TYPE(_C_DBL, double, va_arg_double)
#if __GNUC__ != 2
#ifdef _C_BOOL
CASE_TYPE(_C_BOOL, _Bool, va_arg_uchar)
#endif
@ -1120,7 +1120,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
CASE_TYPE(_C_ULNG_LNG, unsigned long long, va_return_ulonglong)
CASE_TYPE(_C_FLT, float, va_return_float)
CASE_TYPE(_C_DBL, double, va_return_double)
#if __GNUC__ != 2
#ifdef _C_BOOL
CASE_TYPE(_C_BOOL, _Bool, va_return_uchar)
#endif

View file

@ -61,7 +61,7 @@ typeSize(const char* type)
case _C_ULNG_LNG: return sizeof(unsigned long long);
case _C_FLT: return sizeof(float);
case _C_DBL: return sizeof(double);
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL: return sizeof(_Bool);
#endif
case _C_PTR: return sizeof(void*);

View file

@ -310,7 +310,7 @@ static Class NSMutableDataMallocClass;
case _C_ULNG_LNG: info = _GSC_ULNG_LNG | _GSC_S_LNG_LNG; break;
case _C_FLT: info = _GSC_FLT; break;
case _C_DBL: info = _GSC_DBL; break;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL: info = _GSC_BOOL; break;
#endif
default: info = _GSC_NONE; break;
@ -684,7 +684,7 @@ static Class NSMutableDataMallocClass;
(*_serImp)(_dst, serSel, (void*)buf, @encode(double), nil);
return;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
(*_tagImp)(_dst, tagSel, _GSC_BOOL);
(*_serImp)(_dst, serSel, (void*)buf, @encode(_Bool), nil);

View file

@ -1385,7 +1385,7 @@ failure:
*(double*)data = NSSwapBigDoubleToHost(nd);
return;
}
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
{
[self deserializeBytes: data
@ -2672,7 +2672,7 @@ failure:
[self appendBytes: &nd length: sizeof(NSSwappedDouble)];
return;
}
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
[self appendBytes: data length: sizeof(_Bool)];
return;
@ -3159,7 +3159,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
*(double*)data = NSSwapBigDoubleToHost(nd);
return;
}
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
{
getBytes(data, bytes, sizeof(_Bool), length, cursor);
@ -4000,7 +4000,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
(*appendImp)(self, appendSel, &nd, sizeof(NSSwappedDouble));
return;
}
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
(*appendImp)(self, appendSel, data, sizeof(_Bool));
return;

View file

@ -324,7 +324,7 @@ static NSDecimalNumber *one;
llval = (long long)v;
break;
}
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
{
llval = (long long)((*(unsigned char *)value == 0) ? 0 : 1);

View file

@ -573,7 +573,7 @@ cifframe_callback(ffi_cif *cif, void *retp, void **args, void *user)
imp = [[GSKVOSetter class]
instanceMethodForSelector: @selector(setterDouble:)];
break;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
imp = [[GSKVOSetter class]
instanceMethodForSelector: @selector(setterChar:)];

View file

@ -792,7 +792,7 @@ static NSDictionary *makeReference(unsigned ref)
[_enc setObject: o forKey: aKey];
return;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
o = [NSNumber numberWithInt: (NSInteger)*(_Bool*)address];
[_enc setObject: o forKey: aKey];

View file

@ -748,7 +748,7 @@ static NSMapTable *globalClassMap = 0;
*(double*)address = [o doubleValue];
return;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
*(_Bool*)address = (_Bool)[o unsignedCharValue];
return;

View file

@ -332,7 +332,7 @@ next_arg(const char *typePtr, NSArgumentInfo *info, char *outTypes)
info->align = __alignof__(char*);
break;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
info->size = sizeof(_Bool);
info->align = __alignof__(_Bool);

View file

@ -1100,7 +1100,7 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4;
* don't think it matters, because we don't bother with anything
* smaller than int for NSNumbers
*/
#if defined(_C_BOOL)
#ifdef _C_BOOL
case _C_BOOL:
STRING_FROM_NUMBER(unum_format, (int)[anObject boolValue]);
break;

View file

@ -129,7 +129,9 @@ typeToName1(char type)
case _C_CHARPTR: return "cstring";
case _C_ARY_B: return "array";
case _C_STRUCT_B: return "struct";
#ifdef _C_BOOL
case _C_BOOL: return "_Bool";
#endif
default:
{
static char buf1[32];
@ -220,7 +222,11 @@ static char type_map[32] = {
#endif
_C_FLT,
_C_DBL,
#ifdef _C_BOOL
_C_BOOL,
#else
0,
#endif
0,
0,
_C_ID,
@ -517,7 +523,9 @@ static unsigned encodingVersion;
#endif
case _C_FLT: info = _GSC_FLT; break;
case _C_DBL: info = _GSC_DBL; break;
#ifdef _C_BOOL
case _C_BOOL: info = _GSC_BOOL; break;
#endif
default: info = _GSC_NONE; break;
}
@ -1214,7 +1222,9 @@ static unsigned encodingVersion;
case _C_ULNG_LNG: info = _GSC_ULNG_LNG | _GSC_S_LNG_LNG; break;
case _C_FLT: info = _GSC_FLT; break;
case _C_DBL: info = _GSC_DBL; break;
#ifdef _C_BOOL
case _C_BOOL: info = _GSC_BOOL; break;
#endif
default: info = _GSC_NONE; break;
}
@ -1813,7 +1823,7 @@ static unsigned encodingVersion;
(*_eSerImp)(_dst, eSerSel, (void*)buf, @encode(double), nil);
return;
#if __GNUC__ != 2
#ifdef _C_BOOL
case _C_BOOL:
(*_eTagImp)(_dst, eTagSel, _GSC_BOOL);
(*_eSerImp)(_dst, eSerSel, (void*)buf, @encode(_Bool), nil);

View file

@ -78,7 +78,9 @@ typeToName1(char type)
case _C_ULNG_LNG: return "unsigned long long";
case _C_FLT: return "float";
case _C_DBL: return "double";
#ifdef _C_BOOL
case _C_BOOL: return "_Bool";
#endif
case _C_PTR: return "pointer";
case _C_CHARPTR: return "cstring";
case _C_ARY_B: return "array";
@ -168,7 +170,11 @@ static char type_map[32] = {
_C_ULNG_LNG,
_C_FLT,
_C_DBL,
#ifdef _C_BOOL
_C_BOOL,
#else
0,
#endif
0,
0,
_C_ID,
@ -610,7 +616,9 @@ static unsigned encodingVersion;
case _C_ULNG_LNG: info = _GSC_ULNG_LNG; break;
case _C_FLT: info = _GSC_FLT; break;
case _C_DBL: info = _GSC_DBL; break;
#ifdef _C_BOOL
case _C_BOOL: info = _GSC_BOOL; break;
#endif
default: info = _GSC_NONE; break;
}

View file

@ -540,7 +540,7 @@ cifframe_type(const char *typePtr, const char **advance)
case _C_VOID: ftype = &ffi_type_void;
break;
#if __GNUC__ != 2
#if __GNUC__ != 2 && defined(_C_BOOL)
case _C_BOOL: ftype = &ffi_type_uchar;
break;
#endif