From e8a096000b1aad0b459d59d3ac2b84e35c5b3518 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 15 Jan 2017 13:19:17 -0800 Subject: [PATCH] util/thread_local.h: silence a clang-build warning Summary: otherwise clang complains with /home/jenkins/workspace/ceph-master/src/rocksdb/util/thread_local.h:205:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined] ^ /home/jenkins/workspace/ceph-master/src/rocksdb/util/thread_local.h:22:4: note: expanded from macro 'ROCKSDB_SUPPORT_THREAD_LOCAL' !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(IOS_CROSS_COMPILE) ^` Signed-off-by: Kefu Chai Closes https://github.com/facebook/rocksdb/pull/1757 Differential Revision: D4394140 Pulled By: siying fbshipit-source-id: f0beda0 --- util/thread_local.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util/thread_local.h b/util/thread_local.h index 3777ad60d..b935208f1 100644 --- a/util/thread_local.h +++ b/util/thread_local.h @@ -18,8 +18,12 @@ #include "util/autovector.h" #include "port/port.h" -#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(IOS_CROSS_COMPILE) -#define ROCKSDB_SUPPORT_THREAD_LOCAL +#ifndef ROCKSDB_SUPPORT_THREAD_LOCAL +# if defined(OS_WIN) || defined(OS_MACOSX) || defined(IOS_CROSS_COMPILE) +# define ROCKSDB_SUPPORT_THREAD_LOCAL 0 +# else +# define ROCKSDB_SUPPORT_THREAD_LOCAL 1 +# endif #endif namespace rocksdb {