From c86e5d7b9370d4440334a458f9dadf11993a67d6 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 17 Mar 2015 12:00:55 +0100 Subject: [PATCH 1/3] stack_trace.cc: fix #elif check for OS_MACOSX Fix '#elif with no expression' add defined() to check. Signed-off-by: Danny Al-Gaaf --- port/stack_trace.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/stack_trace.cc b/port/stack_trace.cc index b2075b9a9..c7ddd3a1a 100644 --- a/port/stack_trace.cc +++ b/port/stack_trace.cc @@ -71,7 +71,7 @@ void PrintStackTraceLine(const char* symbol, void* frame) { fprintf(stderr, "\n"); } -#elif OS_MACOSX +#elif defined(OS_MACOSX) void PrintStackTraceLine(const char* symbol, void* frame) { static int pid = getpid(); From 87c7d49d6761d90129d8f63d20fe0b2a0accdc80 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 17 Mar 2015 12:03:11 +0100 Subject: [PATCH 2/3] util/env_posix.cc: fix #elif check for __MACH__ Fix '#elif with no expression' add defined() to check. Signed-off-by: Danny Al-Gaaf --- util/env_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/env_posix.cc b/util/env_posix.cc index fa97b6c93..a2e1c714c 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -1409,7 +1409,7 @@ class PosixEnv : public Env { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return static_cast(ts.tv_sec) * 1000000000 + ts.tv_nsec; -#elif __MACH__ +#elif defined(__MACH__) clock_serv_t cclock; mach_timespec_t ts; host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); From 969aa806b715cbcf6c000138ee5d421f4bfbc3bc Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 17 Mar 2015 12:04:05 +0100 Subject: [PATCH 3/3] util/xfunc.h: fix #elif check for NDEBUG Fix '#elif with no expression', add defined() to check. Signed-off-by: Danny Al-Gaaf --- util/xfunc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/xfunc.h b/util/xfunc.h index e7e2e9736..87daa824a 100644 --- a/util/xfunc.h +++ b/util/xfunc.h @@ -20,7 +20,7 @@ namespace rocksdb { #if (ROCKSDB_XFTEST_FORCE == 1) #define XFUNC #endif -#elif NDEBUG +#elif defined(NDEBUG) #else #define XFUNC #endif