From: Mathieu Desnoyers Date: Tue, 13 Oct 2009 16:19:29 +0000 (-0400) Subject: Fix gcc-4.1 x86_64 compability X-Git-Tag: v0.2.3~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=618c4ae180e1d9406bcad808cd0cb88addc992a1;p=userspace-rcu.git Fix gcc-4.1 x86_64 compability Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/arch_x86.h b/urcu/arch_x86.h index 4ba08f7..f137a16 100644 --- a/urcu/arch_x86.h +++ b/urcu/arch_x86.h @@ -29,10 +29,6 @@ #define CACHE_LINE_SIZE 128 -#ifndef BITS_PER_LONG -#define BITS_PER_LONG (__SIZEOF_LONG__ * 8) -#endif - #ifdef CONFIG_URCU_HAVE_FENCE #define mb() asm volatile("mfence":::"memory") #define rmb() asm volatile("lfence":::"memory") diff --git a/urcu/uatomic_arch_x86.h b/urcu/uatomic_arch_x86.h index dfb5876..39ec407 100644 --- a/urcu/uatomic_arch_x86.h +++ b/urcu/uatomic_arch_x86.h @@ -22,6 +22,14 @@ #include +#ifndef __SIZEOF_LONG__ +#if defined(__x86_64__) || defined(__amd64__) +#define __SIZEOF_LONG__ 8 +#else +#define __SIZEOF_LONG__ 4 +#endif +#endif + #ifndef BITS_PER_LONG #define BITS_PER_LONG (__SIZEOF_LONG__ * 8) #endif