From 06db1f50cd754995130ece657a39d534b82d14ae Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 24 Jul 2009 14:32:58 +0200 Subject: [PATCH] fixed compilation with Snow Leopard, thanks to Lon Baker for providing SSH access to Snow Leopard box --- config.h | 6 +++++- redis.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 52f1afdb..c19cfc74 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,10 @@ #ifndef __CONFIG_H #define __CONFIG_H +#ifdef __APPLE__ +#include +#endif + /* test for malloc_size() */ #ifdef __APPLE__ #include @@ -9,7 +13,7 @@ #endif /* define redis_fstat to fstat or fstat64() */ -#ifdef __APPLE__ +#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) #define redis_fstat fstat64 #define redis_stat stat64 #else diff --git a/redis.c b/redis.c index 0dfc36d9..a14cae80 100644 --- a/redis.c +++ b/redis.c @@ -4305,8 +4305,10 @@ static void *getMcontextEip(ucontext_t *uc) { return (void*) uc->uc_mcontext.mc_eip; #elif defined(__dietlibc__) return (void*) uc->uc_mcontext.eip; -#elif defined(__APPLE__) +#elif defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) return (void*) uc->uc_mcontext->__ss.__eip; +#elif defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6) + return (void*) uc->uc_mcontext->__ss.__rip; #elif defined(__i386__) || defined(__X86_64__) /* Linux x86 */ return (void*) uc->uc_mcontext.gregs[REG_EIP]; #elif defined(__ia64__) /* Linux IA64 */