@@ -354,11 +354,11 @@ DISPATCH_EXPORT DISPATCH_NOTHROW void dispatch_atfork_child(void);
354354/* I wish we had __builtin_expect_range() */
355355#if __GNUC__
356356#define _safe_cast_to_long (x ) \
357- ({ _Static_assert(sizeof(typeof (x)) <= sizeof(long), \
357+ ({ _Static_assert(sizeof(__typeof__ (x)) <= sizeof(long), \
358358 "__builtin_expect doesn't support types wider than long"); \
359359 (long)(x); })
360- #define fastpath (x ) ((typeof (x))__builtin_expect(_safe_cast_to_long(x), ~0l))
361- #define slowpath (x ) ((typeof (x))__builtin_expect(_safe_cast_to_long(x), 0l))
360+ #define fastpath (x ) ((__typeof__ (x))__builtin_expect(_safe_cast_to_long(x), ~0l))
361+ #define slowpath (x ) ((__typeof__ (x))__builtin_expect(_safe_cast_to_long(x), 0l))
362362#define likely (x ) __builtin_expect(!!(x), 1)
363363#define unlikely (x ) __builtin_expect(!!(x), 0)
364364#else
@@ -455,7 +455,7 @@ void _dispatch_log(const char *msg, ...);
455455 if (__builtin_constant_p(e)) { \
456456 dispatch_static_assert(e); \
457457 } else { \
458- typeof (e) _e = (e); /* always eval 'e' */ \
458+ __typeof__ (e) _e = (e); /* always eval 'e' */ \
459459 if (unlikely (DISPATCH_DEBUG && !_e )) { \
460460 _dispatch_abort (__LINE__ , (long )_e ); \
461461 } \
@@ -479,7 +479,7 @@ _dispatch_assert(long e, size_t line)
479479 if (__builtin_constant_p(e)) { \
480480 dispatch_static_assert(e); \
481481 } else { \
482- typeof (e) _e = (e); /* always eval 'e' */ \
482+ __typeof__ (e) _e = (e); /* always eval 'e' */ \
483483 if (unlikely (DISPATCH_DEBUG && _e )) { \
484484 _dispatch_abort (__LINE__ , (long )_e ); \
485485 } \
@@ -502,7 +502,7 @@ _dispatch_assert_zero(long e, size_t line)
502502 */
503503#if __GNUC__
504504#define dispatch_assume (e ) ({ \
505- typeof (e) _e = (e); /* always eval 'e' */ \
505+ __typeof__ (e) _e = (e); /* always eval 'e' */ \
506506 if (unlikely(!_e)) { \
507507 if (__builtin_constant_p(e)) { \
508508 dispatch_static_assert(e); \
@@ -527,7 +527,7 @@ _dispatch_assume(long e, long line)
527527 */
528528#if __GNUC__
529529#define dispatch_assume_zero (e ) ({ \
530- typeof (e) _e = (e); /* always eval 'e' */ \
530+ __typeof__ (e) _e = (e); /* always eval 'e' */ \
531531 if (unlikely(_e)) { \
532532 if (__builtin_constant_p(e)) { \
533533 dispatch_static_assert(e); \
@@ -554,7 +554,7 @@ _dispatch_assume_zero(long e, long line)
554554 if (__builtin_constant_p(e)) { \
555555 dispatch_static_assert(e); \
556556 } else { \
557- typeof (e) _e = (e); /* always eval 'e' */ \
557+ __typeof__ (e) _e = (e); /* always eval 'e' */ \
558558 if (unlikely (DISPATCH_DEBUG && !_e )) { \
559559 _dispatch_log ("%s() 0x%lx: " msg , __func__ , (long )_e , ##args ); \
560560 abort(); \
@@ -563,7 +563,7 @@ _dispatch_assume_zero(long e, long line)
563563 } while (0)
564564#else
565565#define dispatch_debug_assert (e , msg , args ...) do { \
566- typeof (e) _e = (e); /* always eval 'e' */ \
566+ __typeof__ (e) _e = (e); /* always eval 'e' */ \
567567 if (unlikely(DISPATCH_DEBUG && !_e)) { \
568568 _dispatch_log("%s() 0x%lx: " msg, __FUNCTION__, _e, ##args); \
569569 abort(); \
@@ -594,7 +594,7 @@ _dispatch_object_debug(dispatch_object_t object, const char *message, ...);
594594 ((dispatch_function_t)((struct Block_layout *)bb)->invoke)
595595void * _dispatch_Block_copy (void * block );
596596#if __GNUC__
597- #define _dispatch_Block_copy (x ) ((typeof (x))_dispatch_Block_copy(x))
597+ #define _dispatch_Block_copy (x ) ((__typeof__ (x))_dispatch_Block_copy(x))
598598#endif
599599void _dispatch_call_block_and_release (void * block );
600600#endif /* __BLOCKS__ */
0 commit comments