Skip to content

Commit fab98ff

Browse files
committed
dispatch: use reserved spelling for typeof
`typeof` is a GNU extension, use the reserved spelling for the keyword. This allows clang to properly deal with this symbol on Windows builds.
1 parent 4211f34 commit fab98ff

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ _dispatch_benchmark_init(void *context)
6060
} while (i < cnt);
6161
delta = _dispatch_uptime() - start;
6262

63-
lcost = (typeof(lcost)) delta;
63+
lcost = (__typeof__(lcost)) delta;
6464
#if HAVE_MACH_ABSOLUTE_TIME
6565
lcost *= bdata->tbi.numer;
6666
lcost /= bdata->tbi.denom;
@@ -113,7 +113,7 @@ dispatch_benchmark_f(size_t count, register void *ctxt,
113113
} while (i < count);
114114
delta = _dispatch_uptime() - start;
115115

116-
conversion = (typeof(conversion)) delta;
116+
conversion = (__typeof__(conversion)) delta;
117117
#if HAVE_MACH_ABSOLUTE_TIME
118118
conversion *= bdata.tbi.numer;
119119
big_denom = bdata.tbi.denom;

src/queue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5762,11 +5762,11 @@ dispatch_channel_enqueue(dispatch_channel_t dch, void *ctxt)
57625762

57635763
#ifndef __APPLE__
57645764
#if __BLOCKS__
5765-
void typeof(dispatch_channel_async) dispatch_channel_async
5765+
void __typeof__(dispatch_channel_async) dispatch_channel_async
57665766
__attribute__((__alias__("dispatch_async")));
57675767
#endif
57685768

5769-
void typeof(dispatch_channel_async_f) dispatch_channel_async_f
5769+
void __typeof__(dispatch_channel_async_f) dispatch_channel_async_f
57705770
__attribute__((__alias__("dispatch_async_f")));
57715771
#endif
57725772

src/shims/atomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ typedef struct { unsigned long __opaque_zero; } os_atomic_dependency_t;
137137
#define OS_ATOMIC_DEPENDENCY_NONE ((os_atomic_dependency_t){ 0UL })
138138
#define os_atomic_make_dependency(v) ((void)(v), OS_ATOMIC_DEPENDENCY_NONE)
139139
#define os_atomic_inject_dependency(p, e) \
140-
((typeof(*(p)) *)((p) + _os_atomic_auto_dependency(e).__opaque_zero))
140+
((__typeof__(*(p)) *)((p) + _os_atomic_auto_dependency(e).__opaque_zero))
141141
#define os_atomic_load_with_dependency_on(p, e) \
142142
os_atomic_load(os_atomic_inject_dependency(p, e), dependency)
143143

0 commit comments

Comments
 (0)