From 93f3e8d511e53133a4367afe04b5f256073082a0 Mon Sep 17 00:00:00 2001 From: Hrvoje Zeba Date: Wed, 10 Jul 2019 20:46:16 -0600 Subject: Use __typeof() instead of typeof() typeof() is not available on all compilers. __typeof() is a safer bet. Signed-off-by: Hrvoje Zeba Signed-off-by: Jens Axboe --- src/barrier.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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; \ }) -- cgit