summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mumford <cmumford@cmumford.com>2016-01-12 10:47:33 -0800
committerChris Mumford <cmumford@cmumford.com>2016-01-12 10:47:33 -0800
commit5d36bedd1cd03022328620fcc3ab6b807e3d30df (patch)
tree387b6268c6b26b560823b1f8ce06974cb15c9be5
parent4753c9b617039d6d3a68f16de64ae9eca49650c0 (diff)
parentceff6f12152785a54885a47db349a6d8dfd0ce2c (diff)
downloadleveldb-5d36bedd1cd03022328620fcc3ab6b807e3d30df.tar.gz
Merge pull request #272 from vapier/master
Fix Android/MIPS build.
-rw-r--r--port/atomic_pointer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/port/atomic_pointer.h b/port/atomic_pointer.h
index 0f6f05e..1c4c7aa 100644
--- a/port/atomic_pointer.h
+++ b/port/atomic_pointer.h
@@ -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 {
@@ -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()