summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHrvoje Zeba <zeba.hrvoje@gmail.com>2019-07-10 20:46:16 -0600
committerJens Axboe <axboe@kernel.dk>2019-07-10 20:46:16 -0600
commit93f3e8d511e53133a4367afe04b5f256073082a0 (patch)
treeb6097b19e6b01afee73f091f0673648e61b12410 /src
parent78cafaa71d747b0e128bcefe933adb4d661702dc (diff)
Use __typeof() instead of typeof()
typeof() is not available on all compilers. __typeof() is a safer bet. Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src')
-rw-r--r--src/barrier.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/barrier.h b/src/barrier.h
index e079cf6..98be9e5 100644
--- a/src/barrier.h
+++ b/src/barrier.h
@@ -27,8 +27,8 @@ after the acquire operation executes. This is implemented using
/* From tools/virtio/linux/compiler.h */
#define WRITE_ONCE(var, val) \
- (*((volatile typeof(val) *)(&(var))) = (val))
-#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var))))
+ (*((volatile __typeof(val) *)(&(var))) = (val))
+#define READ_ONCE(var) (*((volatile __typeof(var) *)(&(var))))
#if defined(__x86_64__) || defined(__i386__)
@@ -52,7 +52,7 @@ do { \
#define smp_load_acquire(p) \
({ \
- typeof(*p) ___p1 = READ_ONCE(*(p)); \
+ __typeof(*p) ___p1 = READ_ONCE(*(p)); \
barrier(); \
___p1; \
})
@@ -78,7 +78,7 @@ do { \
#ifndef smp_load_acquire
# define smp_load_acquire(p) \
({ \
- typeof(*p) ___p1 = READ_ONCE(*p); \
+ __typeof(*p) ___p1 = READ_ONCE(*p); \
smp_mb(); \
___p1; \
})