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(); diff --git a/util/env_posix.cc b/util/env_posix.cc index 2560e02ff..54f30c4eb 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -1412,7 +1412,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); 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