diff options
author | cmumford <cmumford@google.com> | 2019-03-01 13:12:01 -0800 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2019-03-01 18:00:35 -0800 |
commit | c69d33b0ec3dad2a8063ad66da9d51a1d6309f4e (patch) | |
tree | b3ef286b0a30952d87aebd111e161cda94b52563 /port | |
parent | fe4494804f5e3a2e25485d32aeb0eb7d2f25732e (diff) | |
download | leveldb-c69d33b0ec3dad2a8063ad66da9d51a1d6309f4e.tar.gz |
Added native support for Windows.
This change adds a native Windows port (port_windows.h) and a
Windows Env (WindowsEnv).
Note1: "small" is defined when including <Windows.h> so some
parameters were renamed to avoid conflict.
Note2: leveldb::Env defines the method: "DeleteFile" which is
also a constant defined when including <Windows.h>. The solution
was to ensure this macro is defined in env.h which forces
the function, when compiled, to be either DeleteFileA or
DeleteFileW when building for MBCS or UNICODE respectively.
This resolves #519 on GitHub.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=236364778
Diffstat (limited to 'port')
-rw-r--r-- | port/atomic_pointer.h | 4 | ||||
-rw-r--r-- | port/port.h | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/port/atomic_pointer.h b/port/atomic_pointer.h index bb4e183..d906f63 100644 --- a/port/atomic_pointer.h +++ b/port/atomic_pointer.h @@ -22,10 +22,6 @@ #include <atomic> -#ifdef OS_WIN -#include <windows.h> -#endif - #if defined(_M_X64) || defined(__x86_64__) #define ARCH_CPU_X86_FAMILY 1 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) diff --git a/port/port.h b/port/port.h index 0975fed..b2210a7 100644 --- a/port/port.h +++ b/port/port.h @@ -10,7 +10,7 @@ // Include the appropriate platform specific file below. If you are // porting to a new platform, see "port_example.h" for documentation // of what the new port_<platform>.h file must provide. -#if defined(LEVELDB_PLATFORM_POSIX) +#if defined(LEVELDB_PLATFORM_POSIX) || defined(LEVELDB_PLATFORM_WINDOWS) # include "port/port_stdcxx.h" #elif defined(LEVELDB_PLATFORM_CHROMIUM) # include "port/port_chromium.h" |