From 440525ebaa49e4a26aa08fb8129d18bfc58d4209 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Fri, 24 Jan 2014 10:12:07 -0200 Subject: [PATCH] apply leveldb cygwin patch from http://code.google.com/p/leveldb/issues/detail?id=188 --- src/leveldb/build_detect_platform | 6 ++++++ src/leveldb/port/port_posix.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/leveldb/build_detect_platform b/src/leveldb/build_detect_platform index a3ad057e..bfcbe194 100755 --- a/src/leveldb/build_detect_platform +++ b/src/leveldb/build_detect_platform @@ -68,6 +68,12 @@ if [ "$CXX" = "g++" ]; then fi case "$TARGET_OS" in + CYGWIN_*) + PLATFORM=OS_LINUX + COMMON_FLAGS="$MEMCMP_FLAG -lpthread -DOS_LINUX -DCYGWIN" + PLATFORM_LDFLAGS="-lpthread" + PORT_FILE=port/port_posix.cc + ;; Darwin) PLATFORM=OS_MACOSX COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX" diff --git a/src/leveldb/port/port_posix.h b/src/leveldb/port/port_posix.h index f2b89bff..46679213 100644 --- a/src/leveldb/port/port_posix.h +++ b/src/leveldb/port/port_posix.h @@ -55,7 +55,7 @@ #if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\ defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\ - defined(OS_ANDROID) || defined(OS_HPUX) + defined(OS_ANDROID) || defined(OS_HPUX) || defined(CYGWIN) // Use fread/fwrite/fflush on platforms without _unlocked variants #define fread_unlocked fread #define fwrite_unlocked fwrite