--- 4.9.9-gentoo/build/include/linux/compiler.h 2016-12-11 20:17:54.000000000 +0100 +++ 4.9.11-gentoo/build/include/linux/compiler.h 2017-02-19 16:48:37.245713902 +0100 @@ -299,6 +299,7 @@ * with an explicit memory barrier or atomic instruction that provides the * required ordering. */ +#ifndef __cplusplus #define __READ_ONCE(x, check) \ ({ \ @@ -309,6 +310,17 @@ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ __u.__val; \ }) +#else +#define __READ_ONCE(x, check) \ +({ \ + union { typeof(x) __val; char __c[1]={0}; } __u; \ + if (check) \ + __read_once_size(&(x), __u.__c, sizeof(x)); \ + else \ + __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ + __u.__val; \ +}) +#endif #define READ_ONCE(x) __READ_ONCE(x, 1) /*