Skip to content

Commit

Permalink
Fix Android/MIPS build.
Browse files Browse the repository at this point in the history
port/atomic_pointer.h was missing an implementation for
MemoryBarrier() for this platform.
  • Loading branch information
digit-android authored and vapier committed Dec 17, 2014
1 parent 77948e7 commit ceff6f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions port/atomic_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#define ARCH_CPU_ARM64_FAMILY 1
#elif defined(__ppc__) || defined(__powerpc__) || defined(__powerpc64__)
#define ARCH_CPU_PPC_FAMILY 1
#elif defined(__mips__)
#define ARCH_CPU_MIPS_FAMILY 1
#endif

namespace leveldb {
Expand Down Expand Up @@ -110,6 +112,13 @@ inline void MemoryBarrier() {
}
#define LEVELDB_HAVE_MEMORY_BARRIER

// MIPS
#elif defined(ARCH_CPU_MIPS_FAMILY) && defined(__GNUC__)
inline void MemoryBarrier() {
__asm__ __volatile__("sync" : : : "memory");
}
#define LEVELDB_HAVE_MEMORY_BARRIER

#endif

// AtomicPointer built using platform-specific MemoryBarrier()
Expand Down

0 comments on commit ceff6f1

Please sign in to comment.