Skip to content

Commit

Permalink
leveldb compat fix for MACOS
Browse files Browse the repository at this point in the history
  • Loading branch information
iFoggz committed Sep 26, 2017
1 parent 66fd8ef commit 9e79bd2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/leveldb/build_detect_platform
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fi
case "$TARGET_OS" in
Darwin)
PLATFORM=OS_MACOSX
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
COMMON_FLAGS="$MEMCMP_FLAG"
PLATFORM_SHARED_EXT=dylib
[ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name $INSTALL_PATH/"
Expand Down Expand Up @@ -139,7 +139,7 @@ case "$TARGET_OS" in
;;
IOS)
PLATFORM=IOS
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
COMMON_FLAGS="$MEMCMP_FLAG"
[ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
PORT_FILE=port/port_posix.cc
PLATFORM_SHARED_EXT=
Expand Down
4 changes: 2 additions & 2 deletions src/leveldb/port/atomic_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifdef OS_WIN
#include <windows.h>
#endif
#ifdef OS_MACOSX
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif

Expand All @@ -53,7 +53,7 @@ namespace port {
#define LEVELDB_HAVE_MEMORY_BARRIER

// Mac OS
#elif defined(OS_MACOSX)
#elif defined(__APPLE__)
inline void MemoryBarrier() {
OSMemoryBarrier();
}
Expand Down
6 changes: 3 additions & 3 deletions src/leveldb/port/port_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define STORAGE_LEVELDB_PORT_PORT_POSIX_H_

#undef PLATFORM_IS_LITTLE_ENDIAN
#if defined(OS_MACOSX)
#if defined(__APPLE__)
#include <machine/endian.h>
#if defined(__DARWIN_LITTLE_ENDIAN) && defined(__DARWIN_BYTE_ORDER)
#define PLATFORM_IS_LITTLE_ENDIAN \
Expand Down Expand Up @@ -53,7 +53,7 @@
#define PLATFORM_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)
#endif

#if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\
#if defined(__APPLE__) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\
defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\
defined(OS_ANDROID) || defined(OS_HPUX)
// Use fread/fwrite/fflush on platforms without _unlocked variants
Expand All @@ -68,7 +68,7 @@
#define fdatasync fsync
#endif

#if defined(OS_MACOSX)
#if defined(__APPLE__)
#define fdatasync(fd) fcntl(fd, F_FULLFSYNC, 0)
#endif

Expand Down

0 comments on commit 9e79bd2

Please sign in to comment.