From 618c4ae180e1d9406bcad808cd0cb88addc992a1 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 13 Oct 2009 12:19:29 -0400 Subject: [PATCH] Fix gcc-4.1 x86_64 compability Signed-off-by: Mathieu Desnoyers --- urcu/arch_x86.h | 4 ---- urcu/uatomic_arch_x86.h | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) 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 -- 2.34.1