From 9fc72d6f161add2940f12359123a01214dd24d73 Mon Sep 17 00:00:00 2001 From: Chinmay Kamat Date: Fri, 9 Feb 2018 14:01:10 -0800 Subject: [PATCH] Compilation fixes for powerpc build, -Wparentheses-equality error and missing header guards Summary: This pull request contains miscellaneous compilation fixes. Thanks, Chinmay Closes https://github.com/facebook/rocksdb/pull/3462 Differential Revision: D6941424 Pulled By: sagar0 fbshipit-source-id: fe9c26507bf131221f2466740204bff40a15614a --- monitoring/perf_context_imp.h | 2 +- tools/db_stress.cc | 3 +++ tools/write_stress.cc | 3 +++ util/crc32c.cc | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/monitoring/perf_context_imp.h b/monitoring/perf_context_imp.h index 159e46363..90774e826 100644 --- a/monitoring/perf_context_imp.h +++ b/monitoring/perf_context_imp.h @@ -43,7 +43,7 @@ extern __thread PerfContext perf_context; #define PERF_CONDITIONAL_TIMER_FOR_MUTEX_GUARD(metric, condition) \ PerfStepTimer perf_step_timer_##metric(&(perf_context.metric), true); \ - if ((condition)) { \ + if (condition) { \ perf_step_timer_##metric.Start(); \ } diff --git a/tools/db_stress.cc b/tools/db_stress.cc index f24764b69..d7d3405ea 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -28,7 +28,10 @@ int main() { } #else +#ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS +#endif // __STDC_FORMAT_MACROS + #include #include #include diff --git a/tools/write_stress.cc b/tools/write_stress.cc index c010f5edf..ddb1d0aed 100644 --- a/tools/write_stress.cc +++ b/tools/write_stress.cc @@ -56,7 +56,10 @@ int main() { } #else +#ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS +#endif // __STDC_FORMAT_MACROS + #include #include #include diff --git a/util/crc32c.cc b/util/crc32c.cc index 3c56ad7c1..745ce254b 100644 --- a/util/crc32c.cc +++ b/util/crc32c.cc @@ -39,8 +39,10 @@ namespace rocksdb { namespace crc32c { +#if defined(HAVE_POWER8) && defined(HAS_ALTIVEC) #ifdef __powerpc64__ static int arch_ppc_crc32 = 0; +#endif /* __powerpc64__ */ #endif static const uint32_t table0_[256] = {