Consistently use __typeof__() rather than typeof() or __typeof() for compatibility (GCC and clang and, perhaps, other future compilers) irrespective of -std= compilation options.

This commit is contained in:
Richard Frith-Macdonald 2020-12-15 13:01:00 +00:00
parent 5026274f6c
commit 6d20773f56
11 changed files with 30 additions and 30 deletions

View file

@ -3573,7 +3573,7 @@ substring_c(GSStr self, NSRange aRange)
{
return @"";
}
o = (typeof(o))NSAllocateObject(GSCSubStringClass,
o = (__typeof__(o))NSAllocateObject(GSCSubStringClass,
0, NSDefaultMallocZone());
o->_contents.c = self->_contents.c + aRange.location;
o->_count = aRange.length;
@ -3592,7 +3592,7 @@ substring_u(GSStr self, NSRange aRange)
{
return @"";
}
o = (typeof(o))NSAllocateObject(GSUnicodeSubStringClass,
o = (__typeof__(o))NSAllocateObject(GSUnicodeSubStringClass,
0, NSDefaultMallocZone());
o->_contents.u = self->_contents.u + aRange.location;
o->_count = aRange.length;