X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fcompiler.h;fp=urcu%2Fcompiler.h;h=fc2425cd5ff2f4c0aaf8f83d4c820d36ec2a9424;hp=08bd9e9f44fa004a744f98d1734a5131bc670428;hb=e56d99bf2046a163875df80bab5195f38606dfde;hpb=7d5dc80de0522da1b8bc3656646ea39c15481594 diff --git a/urcu/compiler.h b/urcu/compiler.h index 08bd9e9..fc2425c 100644 --- a/urcu/compiler.h +++ b/urcu/compiler.h @@ -86,4 +86,9 @@ #define URCU_FORCE_CAST(type, arg) ((type) (arg)) #endif +#define caa_is_signed_type(type) (((type) (-1)) < 0) + +#define caa_cast_long_keep_sign(v) \ + (caa_is_signed_type(__typeof__(v)) ? (long) (v) : (unsigned long) (v)) + #endif /* _URCU_COMPILER_H */