瀏覽代碼

Bypass OSMemoryBarrier() warning on Mac.

This is a stopgap for removing warnings on Mac builds, so -Werror can be
turned on. C++11 will be required in the nearby future, which guarantees
<atomic> support. Once that happens, the simplified version of this will
match https://github.com/google/leveldb/pull/503

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188553251
ld
costan 6 年之前
committed by Victor Costan
父節點
當前提交
594cc987af
共有 1 個檔案被更改,包括 6 行新增3 行删除
  1. +6
    -3
      port/atomic_pointer.h

+ 6
- 3
port/atomic_pointer.h 查看文件

@ -21,13 +21,12 @@
#include <stdint.h>
#ifdef LEVELDB_ATOMIC_PRESENT
#include <atomic>
#elif defined(__APPLE__)
#include <libkern/OSAtomic.h>
#endif
#ifdef OS_WIN
#include <windows.h>
#endif
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif
#if defined(_M_X64) || defined(__x86_64__)
#define ARCH_CPU_X86_FAMILY 1
@ -56,7 +55,11 @@ namespace port {
// Mac OS
#elif defined(__APPLE__)
inline void MemoryBarrier() {
#if defined(LEVELDB_ATOMIC_PRESENT)
std::atomic_thread_fence(std::memory_order_seq_cst);
#else
OSMemoryBarrier();
#endif // defined(LEVELDB_ATOMIC_PRESENT)
}
#define LEVELDB_HAVE_MEMORY_BARRIER

Loading…
取消
儲存