diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-09-04 23:01:03 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-10-20 23:08:56 +0200 |
commit | 9f56678fceef0a53411bdfcac82ab65f7b896838 (patch) | |
tree | 23b1e40a31e0177beb6ab65d06e4458d6feb04af | |
parent | 9d503a72855167fcfa66362657d3f93f7b823774 (diff) |
Backport Win32 LevelDB env from C++0x to C++
Since the gitian mingw compiler doesn't support C++0x yet.
-rwxr-xr-x | src/leveldb/build_detect_platform | 2 | ||||
-rw-r--r-- | src/leveldb/port/port_win.cc | 4 | ||||
-rw-r--r-- | src/leveldb/port/port_win.h | 2 | ||||
-rw-r--r-- | src/leveldb/util/env_boost.cc | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/leveldb/build_detect_platform b/src/leveldb/build_detect_platform index 385b5effdc..dd982236fd 100755 --- a/src/leveldb/build_detect_platform +++ b/src/leveldb/build_detect_platform @@ -112,7 +112,7 @@ case "$TARGET_OS" in OS_WINDOWS_CROSSCOMPILE) PLATFORM=OS_WINDOWS COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DBOOST_THREAD_USE_LIB" - PLATFORM_CXXFLAGS="-std=c++0x" + PLATFORM_CXXFLAGS="" PLATFORM_LDFLAGS="" PLATFORM_SHARED_CFLAGS="" PLATFORM_SOURCES="port/port_win.cc util/env_boost.cc util/win_logger.cc" diff --git a/src/leveldb/port/port_win.cc b/src/leveldb/port/port_win.cc index 4ca64acbef..786cd6018a 100644 --- a/src/leveldb/port/port_win.cc +++ b/src/leveldb/port/port_win.cc @@ -134,7 +134,7 @@ AtomicPointer::AtomicPointer(void* v) { } void* AtomicPointer::Acquire_Load() const { - void * p = nullptr; + void * p = NULL; InterlockedExchangePointer(&p, rep_); return p; } @@ -160,7 +160,7 @@ enum InitializationState void InitOnce(OnceType* once, void (*initializer)()) { - static_assert(Uninitialized == LEVELDB_ONCE_INIT, "Invalid uninitialized state value"); + assert(Uninitialized == LEVELDB_ONCE_INIT); InitializationState state = static_cast<InitializationState>(InterlockedCompareExchange(once, Running, Uninitialized)); diff --git a/src/leveldb/port/port_win.h b/src/leveldb/port/port_win.h index b53d6ef70d..893919998c 100644 --- a/src/leveldb/port/port_win.h +++ b/src/leveldb/port/port_win.h @@ -104,7 +104,7 @@ class AtomicPointer { private: void * rep_; public: - AtomicPointer() : rep_(nullptr) { } + AtomicPointer() : rep_(NULL) { } explicit AtomicPointer(void* v); void* Acquire_Load() const; diff --git a/src/leveldb/util/env_boost.cc b/src/leveldb/util/env_boost.cc index 0190f9fb77..055c657438 100644 --- a/src/leveldb/util/env_boost.cc +++ b/src/leveldb/util/env_boost.cc @@ -401,7 +401,7 @@ class PosixEnv : public Env { boost::interprocess::file_lock fl(fname.c_str()); BoostFileLock * my_lock = new BoostFileLock(); - my_lock->fl_ = std::move(fl); + fl.swap(my_lock->fl_); if (!my_lock->fl_.try_lock()) { return Status::IOError("database already in use: could not acquire exclusive lock"); } |