diff options
Diffstat (limited to 'src/leveldb/port')
-rw-r--r-- | src/leveldb/port/port_win.cc | 6 | ||||
-rw-r--r-- | src/leveldb/port/port_win.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/leveldb/port/port_win.cc b/src/leveldb/port/port_win.cc index 15dfde1f27..99c1d8e346 100644 --- a/src/leveldb/port/port_win.cc +++ b/src/leveldb/port/port_win.cc @@ -37,7 +37,7 @@ namespace leveldb { namespace port { Mutex::Mutex() : - cs_(nullptr) { + cs_(NULL) { assert(!cs_); cs_ = static_cast<void *>(new CRITICAL_SECTION()); ::InitializeCriticalSection(static_cast<CRITICAL_SECTION *>(cs_)); @@ -48,7 +48,7 @@ Mutex::~Mutex() { assert(cs_); ::DeleteCriticalSection(static_cast<CRITICAL_SECTION *>(cs_)); delete static_cast<CRITICAL_SECTION *>(cs_); - cs_ = nullptr; + cs_ = NULL; assert(!cs_); } @@ -128,7 +128,7 @@ void InitOnce(OnceType* once, void (*initializer)()) { } void* AtomicPointer::Acquire_Load() const { - void * p = nullptr; + void * p = NULL; InterlockedExchangePointer(&p, rep_); return p; } diff --git a/src/leveldb/port/port_win.h b/src/leveldb/port/port_win.h index 849b01705f..45bf2f0ea7 100644 --- a/src/leveldb/port/port_win.h +++ b/src/leveldb/port/port_win.h @@ -31,9 +31,11 @@ #ifndef STORAGE_LEVELDB_PORT_PORT_WIN_H_ #define STORAGE_LEVELDB_PORT_PORT_WIN_H_ +#ifdef _MSC_VER #define snprintf _snprintf #define close _close #define fread_unlocked _fread_nolock +#endif #include <string> #include <stdint.h> @@ -120,7 +122,7 @@ class AtomicPointer { private: void * rep_; public: - AtomicPointer() : rep_(nullptr) { } + AtomicPointer() : rep_(NULL) { } explicit AtomicPointer(void* v); void* Acquire_Load() const; |