From e5d0ea5de90a5799232f841e0d1ef2dd40fe1cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 3 Jun 2016 04:48:02 -0400 Subject: [PATCH] Switch from to Switch from to . The former never made it into the standard and doesn't exist in modern gcc versions at all. The later contains everything that leveldb was using from the former. Backported from Google leveldb 1.18 https://github.com/google/leveldb/commit/803d69203a62faf50f1b77897310a3a1fcae712b --- build_detect_platform | 4 ++-- port/atomic_pointer.h | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build_detect_platform b/build_detect_platform index adbeaf16..884a158d 100755 --- a/build_detect_platform +++ b/build_detect_platform @@ -156,11 +156,11 @@ if [ "$CROSS_COMPILE" = "true" ]; then else # If -std=c++0x works, use . Otherwise use port_posix.h. $CXX $CFLAGS -std=c++0x -x c++ - -o /dev/null 2>/dev/null < + #include int main() {} EOF if [ "$?" = 0 ]; then - COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT" + COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT" PLATFORM_CXXFLAGS="-std=c++0x" else COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX" diff --git a/port/atomic_pointer.h b/port/atomic_pointer.h index 2b485c7f..18bd5bee 100644 --- a/port/atomic_pointer.h +++ b/port/atomic_pointer.h @@ -20,9 +20,9 @@ #define PORT_ATOMIC_POINTER_H_ #include -//#ifdef LEVELDB_CSTDATOMIC_PRESENT -//#include ... moved below -//#endif +#ifdef LEVELDB_ATOMIC_PRESENT +#include +#endif #ifdef OS_WIN #include #endif @@ -114,9 +114,8 @@ class AtomicPointer { } }; -// AtomicPointer based on -#elif defined(LEVELDB_CSTDATOMIC_PRESENT) -#include +// AtomicPointer based on +#elif defined(LEVELDB_ATOMIC_PRESENT) class AtomicPointer { private: