diff --git a/Headers/GNUstepBase/GNUstep.h b/Headers/GNUstepBase/GNUstep.h index 570351a5a..e7525acfe 100644 --- a/Headers/GNUstepBase/GNUstep.h +++ b/Headers/GNUstepBase/GNUstep.h @@ -168,7 +168,7 @@ void *__object = (void*)(object);\ */ #define ASSIGN(object,value) ({\ void *__object = (void*)object; \ - object = (typeof(object))[(value) retain]; \ + object = (__typeof__(object))[(value) retain]; \ [(id)__object release]; \ }) #endif @@ -181,7 +181,7 @@ void *__object = (void*)(object);\ */ #define ASSIGNCOPY(object,value) ({\ void *__object = (void*)object; \ - object = (typeof(object))[(value) copy];\ + object = (__typeof__(object))[(value) copy];\ [(id)__object release]; \ }) #endif @@ -194,7 +194,7 @@ void *__object = (void*)(object);\ */ #define ASSIGNMUTABLECOPY(object,value) ({\ void *__object = (void*)object; \ - object = (typeof(object))[(value) mutableCopy];\ + object = (__typeof__(object))[(value) mutableCopy];\ [(id)__object release]; \ }) #endif diff --git a/Headers/GNUstepBase/GSBlocks.h b/Headers/GNUstepBase/GSBlocks.h index de0045d00..3295d4d56 100644 --- a/Headers/GNUstepBase/GSBlocks.h +++ b/Headers/GNUstepBase/GSBlocks.h @@ -134,7 +134,7 @@ void _Block_release(const void *) __attribute__((weak)); #endif #ifndef Block_copy -# define Block_copy(x) ((__typeof(x))_Block_copy((const void *)(x))) +# define Block_copy(x) ((__typeof__(x))_Block_copy((const void *)(x))) #endif #ifndef Block_release # define Block_release(x) _Block_release((const void *)(x)) diff --git a/Headers/ObjectiveC2/objc/blocks_runtime.h b/Headers/ObjectiveC2/objc/blocks_runtime.h index aab133252..b23ffe944 100644 --- a/Headers/ObjectiveC2/objc/blocks_runtime.h +++ b/Headers/ObjectiveC2/objc/blocks_runtime.h @@ -12,5 +12,5 @@ BLOCKS_EXPORT void *_Block_copy(const void *); BLOCKS_EXPORT void _Block_release(const void *); BLOCKS_EXPORT const char *_Block_get_types(const void*); -#define Block_copy(x) ((__typeof(x))_Block_copy((const void *)(x))) +#define Block_copy(x) ((__typeof__(x))_Block_copy((const void *)(x))) #define Block_release(x) _Block_release((const void *)(x)) diff --git a/Source/GSString.m b/Source/GSString.m index a7a25a796..11f29f21d 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -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; diff --git a/Source/NSConcreteHashTable.m b/Source/NSConcreteHashTable.m index 014fa6e31..aa4fa0542 100644 --- a/Source/NSConcreteHashTable.m +++ b/Source/NSConcreteHashTable.m @@ -101,7 +101,7 @@ typedef GSIMapNode_t *GSIMapNode; pointerFunctionsAssign(&M->cb.pf, (void**)addr, (x).obj); #define GSI_MAP_READ_KEY(M,addr) \ (M->legacy ? *(addr) :\ - (typeof(*addr))pointerFunctionsRead(&M->cb.pf, (void**)addr)) + (__typeof__(*addr))pointerFunctionsRead(&M->cb.pf, (void**)addr)) #define GSI_MAP_ENUMERATOR NSHashEnumerator diff --git a/Source/NSConcreteMapTable.m b/Source/NSConcreteMapTable.m index 8d03c00fc..56627aab0 100644 --- a/Source/NSConcreteMapTable.m +++ b/Source/NSConcreteMapTable.m @@ -132,10 +132,10 @@ typedef GSIMapNode_t *GSIMapNode; (IS_WEAK_VALUE(M) ? pointerFunctionsAssign(&M->cb.pf.v, (void**)addr, (x).obj) : (*(id*)(addr) = (x).obj)); #define GSI_MAP_READ_KEY(M,addr) \ (M->legacy ? *(addr)\ - : (typeof(*addr))pointerFunctionsRead(&M->cb.pf.k, (void**)addr)) + : (__typeof__(*addr))pointerFunctionsRead(&M->cb.pf.k, (void**)addr)) #define GSI_MAP_READ_VALUE(M,addr) \ (M->legacy ? *(addr)\ - : (typeof(*addr))pointerFunctionsRead(&M->cb.pf.v, (void**)addr)) + : (__typeof__(*addr))pointerFunctionsRead(&M->cb.pf.v, (void**)addr)) #define GSI_MAP_ZEROED(M)\ (M->legacy ? 0\ : (IS_WEAK_KEY(M) || IS_WEAK_VALUE(M)) ? YES : NO) diff --git a/Source/NSConnection.m b/Source/NSConnection.m index d738d93e1..7406f24b1 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -2923,14 +2923,14 @@ static NSLock *cached_proxies_gate = nil; NSParameterAssert (IisValid); [rmc decodeValueOfObjCType: @encode(int) at: &sequence]; - [rmc decodeValueOfObjCType: @encode(typeof(count)) at: &count]; + [rmc decodeValueOfObjCType: @encode(__typeof__(count)) at: &count]; for (pos = 0; pos < count; pos++) { unsigned target; NSDistantObject *prox; - [rmc decodeValueOfObjCType: @encode(typeof(target)) at: &target]; + [rmc decodeValueOfObjCType: @encode(__typeof__(target)) at: &target]; prox = [self includesLocalTarget: target]; if (prox != 0) @@ -2985,7 +2985,7 @@ static NSLock *cached_proxies_gate = nil; [rmc decodeValueOfObjCType: @encode(int) at: &sequence]; op = [self _newOutRmc: sequence generate: 0 reply: NO]; - [rmc decodeValueOfObjCType: @encode(typeof(target)) at: &target]; + [rmc decodeValueOfObjCType: @encode(__typeof__(target)) at: &target]; [self _doneInRmc: rmc]; if (debug_connection > 3) @@ -3823,7 +3823,7 @@ static NSLock *cached_proxies_gate = nil; int seq_num; op = [self _newOutRmc: 0 generate: &seq_num reply: YES]; - [op encodeValueOfObjCType: @encode(typeof(target)) at: &target]; + [op encodeValueOfObjCType: @encode(__typeof__(target)) at: &target]; [self _sendOutRmc: op type: PROXY_RETAIN sequence: seq_num]; ip = [self _getReplyRmc: seq_num for: "retain"]; diff --git a/Source/NSDistantObject.m b/Source/NSDistantObject.m index 4dc706e99..ad2738027 100644 --- a/Source/NSDistantObject.m +++ b/Source/NSDistantObject.m @@ -192,7 +192,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder NSAssert(decoder_connection, NSInternalInconsistencyException); /* First get the tag, so we know what values need to be decoded. */ - [aCoder decodeValueOfObjCType: @encode(typeof(proxy_tag)) + [aCoder decodeValueOfObjCType: @encode(__typeof__(proxy_tag)) at: &proxy_tag]; switch (proxy_tag) @@ -204,7 +204,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder * Lookup the target handle to ensure that it exists here. * Return a retained copy of the local target object. */ - [aCoder decodeValueOfObjCType: @encode(typeof(target)) + [aCoder decodeValueOfObjCType: @encode(__typeof__(target)) at: &target]; if (debug_proxy) @@ -236,7 +236,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder * return the proxy object we already created for this target, or * create a new proxy object if necessary. */ - [aCoder decodeValueOfObjCType: @encode(typeof(target)) + [aCoder decodeValueOfObjCType: @encode(__typeof__(target)) at: &target]; if (debug_proxy) NSLog(@"Receiving a proxy, was local 0x%x connection %p\n", @@ -273,7 +273,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder * time we will have obtained our own proxy for the original * object ... */ - [aCoder decodeValueOfObjCType: @encode(typeof(intermediary)) + [aCoder decodeValueOfObjCType: @encode(__typeof__(intermediary)) at: &intermediary]; AUTORELEASE([self initWithTarget: intermediary connection: decoder_connection]); @@ -283,7 +283,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder * and (if necessary) get the originating process to retain the * object for us. */ - [aCoder decodeValueOfObjCType: @encode(typeof(target)) + [aCoder decodeValueOfObjCType: @encode(__typeof__(target)) at: &target]; [aCoder decodeValueOfObjCType: @encode(id) @@ -513,10 +513,10 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder NSLog(@"Sending a proxy, will be remote 0x%x connection %p\n", proxy_target, _connection); - [aRmc encodeValueOfObjCType: @encode(typeof(proxy_tag)) + [aRmc encodeValueOfObjCType: @encode(__typeof__(proxy_tag)) at: &proxy_tag]; - [aRmc encodeValueOfObjCType: @encode(typeof(proxy_target)) + [aRmc encodeValueOfObjCType: @encode(__typeof__(proxy_target)) at: &proxy_target]; /* * Tell connection this object is being vended. @@ -534,10 +534,10 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder NSLog(@"Sending a proxy, will be local 0x%x connection %p\n", proxy_target, _connection); - [aRmc encodeValueOfObjCType: @encode(typeof(proxy_tag)) + [aRmc encodeValueOfObjCType: @encode(__typeof__(proxy_tag)) at: &proxy_tag]; - [aRmc encodeValueOfObjCType: @encode(typeof(proxy_target)) + [aRmc encodeValueOfObjCType: @encode(__typeof__(proxy_target)) at: &proxy_target]; } } @@ -577,13 +577,13 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder * It's remote here, so we need to tell other side where to form * triangle connection to */ - [aRmc encodeValueOfObjCType: @encode(typeof(proxy_tag)) + [aRmc encodeValueOfObjCType: @encode(__typeof__(proxy_tag)) at: &proxy_tag]; - [aRmc encodeValueOfObjCType: @encode(typeof(localProxy->_handle)) + [aRmc encodeValueOfObjCType: @encode(__typeof__(localProxy->_handle)) at: &localProxy->_handle]; - [aRmc encodeValueOfObjCType: @encode(typeof(proxy_target)) + [aRmc encodeValueOfObjCType: @encode(__typeof__(proxy_target)) at: &proxy_target]; [aRmc encodeBycopyObject: proxy_connection_out_port]; diff --git a/Source/NSMethodSignature.m b/Source/NSMethodSignature.m index 63a979c8d..fcfaaa5f0 100644 --- a/Source/NSMethodSignature.m +++ b/Source/NSMethodSignature.m @@ -63,7 +63,7 @@ skip_offset(const char *ptr) } #define ROUND(V, A) \ - ({ typeof(V) __v=(V); typeof(A) __a=(A); \ + ({ __typeof__(V) __v=(V); __typeof__(A) __a=(A); \ __a*((__v+__a-1)/__a); }) /* Step through method encoding information extracting details. diff --git a/Source/NSNumberMethods.h b/Source/NSNumberMethods.h index e26badf19..2ca79ef10 100644 --- a/Source/NSNumberMethods.h +++ b/Source/NSNumberMethods.h @@ -10,7 +10,7 @@ } - (const char *) objCType { - return @encode(typeof(VALUE)); + return @encode(__typeof__(VALUE)); } - (NSString*) descriptionWithLocale: (id)aLocale { @@ -19,7 +19,7 @@ } - (void) getValue: (void*)buffer { - typeof(VALUE) *ptr = buffer; + __typeof__(VALUE) *ptr = buffer; *ptr = VALUE; } #undef FORMAT diff --git a/Tools/gdomap.c b/Tools/gdomap.c index d8c73c9f6..f1324466d 100644 --- a/Tools/gdomap.c +++ b/Tools/gdomap.c @@ -153,7 +153,7 @@ static errbuf[BUFSIZ]; #define MAX_EXTRA ((GDO_NAME_MAX_LEN - 2 * IASIZE)/IASIZE) #define ROUND(V, A) \ - ({ typeof(V) __v=(V); typeof(A) __a=(A); \ + ({ __typeof__(V) __v=(V); __typeof__(A) __a=(A); \ __a*((__v+__a-1)/__a); }) typedef unsigned char *uptr;