X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Furcu%2Fcompiler.h;h=2f32b38d6fb1850291ebd500f0a2fdca53f5c428;hb=06326a94ac233064654c7100b6384b2833f7b898;hp=157346763078a3ec1d73b7c65618ed1bd98b325f;hpb=2875743718fb23293190b5edd0f2b530977270b1;p=userspace-rcu.git diff --git a/include/urcu/compiler.h b/include/urcu/compiler.h index 1573467..2f32b38 100644 --- a/include/urcu/compiler.h +++ b/include/urcu/compiler.h @@ -21,6 +21,10 @@ #include /* for offsetof */ +#if defined __cplusplus +# include /* for std::remove_cv */ +#endif + #define caa_likely(x) __builtin_expect(!!(x), 1) #define caa_unlikely(x) __builtin_expect(!!(x), 0) @@ -82,7 +86,7 @@ #define __rcu #ifdef __cplusplus -#define URCU_FORCE_CAST(type, arg) (reinterpret_cast(arg)) +#define URCU_FORCE_CAST(_type, arg) (reinterpret_cast::type>(arg)) #else #define URCU_FORCE_CAST(type, arg) ((type) (arg)) #endif @@ -119,10 +123,4 @@ + __GNUC_PATCHLEVEL__) #endif -#ifndef __cplusplus -#define caa_c_transparent_union __attribute__((__transparent_union__)) -#else -#define caa_c_transparent_union -#endif - #endif /* _URCU_COMPILER_H */