From 8aef119f43ee3b4e75e0f3bd7ea28cf7b29bb582 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 13 Dec 2012 02:23:05 +0100 Subject: [PATCH] Mingw support for Windows LevelDB port --- src/leveldb/build_detect_platform | 10 ++++++++++ src/leveldb/util/env_posix.cc | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/leveldb/build_detect_platform b/src/leveldb/build_detect_platform index 5307c9a4fcb..caf2352f934 100755 --- a/src/leveldb/build_detect_platform +++ b/src/leveldb/build_detect_platform @@ -127,6 +127,16 @@ case "$TARGET_OS" in # man ld: +h internal_name PLATFORM_SHARED_LDFLAGS="-shared -Wl,+h -Wl," ;; + OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS) + PLATFORM=OS_WINDOWS + COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS" + PLATFORM_SHARED_CFLAGS="" + PLATFORM_SOURCES="util/env_win.cc" + PLATFORM_CXXFLAGS="-std=c++0x" + PLATFORM_LIBS="-lshlwapi -ldbghelp" + PORT_FILE=port/port_win.cc + CROSS_COMPILE=true + ;; *) echo "Unknown platform!" >&2 exit 1 diff --git a/src/leveldb/util/env_posix.cc b/src/leveldb/util/env_posix.cc index 78e09c95c99..db81f56d11a 100644 --- a/src/leveldb/util/env_posix.cc +++ b/src/leveldb/util/env_posix.cc @@ -1,6 +1,7 @@ // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#if !defined(LEVELDB_PLATFORM_WINDOWS) #include #include @@ -696,3 +697,5 @@ Env* Env::Default() { } } // namespace leveldb + +#endif