diff --git a/deps/leveldb/leveldb-1.22/port/port_config.h b/deps/leveldb/leveldb-1.22/port/port_config.h new file mode 100644 index 0000000..fe92039 --- /dev/null +++ b/deps/leveldb/leveldb-1.22/port/port_config.h @@ -0,0 +1,81 @@ +// Copyright 2017 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. + +#ifndef STORAGE_LEVELDB_PORT_PORT_CONFIG_H_ +#define STORAGE_LEVELDB_PORT_PORT_CONFIG_H_ + +// Check for fdatasync() in . +#if !defined(HAVE_FDATASYNC) +#if __has_include () + #include + #if defined(fdatasync) + #define HAVE_FDATASYNC 1 + #else + #define HAVE_FDATASYNC 0 + #endif +#else + #define HAVE_FDATASYNC 0 +#endif +#endif // !defined(HAVE_FDATASYNC) + +// Check for F_FULLFSYNC in . +#if !defined(HAVE_FULLFSYNC) +#if __has_include () + #include + #if defined(F_FULLFSYNC) + #define HAVE_FULLFSYNC 1 + #else + #define HAVE_FULLFSYNC 0 + #endif +#else + #define HAVE_FULLFSYNC 0 +#endif +#endif // !defined(HAVE_FULLFSYNC) + +// Check CRC32C. +#if !defined(HAVE_CRC32C) + #define HAVE_CRC32C 0 +#endif // !defined(HAVE_CRC32C) + +// Check Snappy. +#if !defined(HAVE_SNAPPY) + #define HAVE_SNAPPY 1 +#endif // !defined(HAVE_SNAPPY) + +// Check Endianness. +#if !defined(LEVELDB_IS_BIG_ENDIAN) +#if defined(OS_MACOSX) || defined(OS_IOS) + #include +#if defined(__DARWIN_BIG_ENDIAN) && defined(__DARWIN_BYTE_ORDER) + #define LEVELDB_IS_BIG_ENDIAN \ +(__DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN) + #endif +#elif defined(OS_SOLARIS) + #include + #ifdef _BIG_ENDIAN + #define LEVELDB_IS_BIG_ENDIAN true + #else + #define LEVELDB_IS_BIG_ENDIAN false + #endif +#elif defined(OS_FREEBSD) || defined(OS_OPENBSD) ||\ + defined(OS_NETBSD) || defined(OS_DRAGONFLYBSD) + #include + #include +#define LEVELDB_IS_BIG_ENDIAN (_BYTE_ORDER == _BIG_ENDIAN) +#elif defined(OS_HPUX) + #define LEVELDB_IS_BIG_ENDIAN true +#elif defined(OS_ANDROID) +// Due to a bug in the NDK x86 definition, +// _BYTE_ORDER must be used instead of __BYTE_ORDER on Android. +// See http://code.google.com/p/android/issues/detail?id=39824 + #include +#define LEVELDB_IS_BIG_ENDIAN (_BYTE_ORDER == _BIG_ENDIAN) +#else + #include +#define LEVELDB_IS_BIG_ENDIAN (__BYTE_ORDER == __BIG_ENDIAN) +#endif + +#endif // !defined(LEVELDB_IS_BIG_ENDIAN) + +#endif // STORAGE_LEVELDB_PORT_PORT_CONFIG_H_ diff --git a/deps/leveldb/leveldb.gyp b/deps/leveldb/leveldb.gyp index 879dd80..4ac24fd 100644 --- a/deps/leveldb/leveldb.gyp +++ b/deps/leveldb/leveldb.gyp @@ -17,13 +17,7 @@ "leveldb-<(ldbversion)/" ] }, - "defines": [ - "HAVE_FDATASYNC=1", - "HAVE_FULLFSYNC=0", - "HAVE_CRC32C=0", - "HAVE_SNAPPY=1", - "LEVELDB_IS_BIG_ENDIAN=0" - ], + "defines": [], "include_dirs": [ "leveldb-<(ldbversion)/", "leveldb-<(ldbversion)/include/" @@ -230,6 +224,7 @@ "leveldb-<(ldbversion)/include/leveldb/table.h", "leveldb-<(ldbversion)/include/leveldb/write_batch.h", "leveldb-<(ldbversion)/port/port.h", + "leveldb-<(ldbversion)/port/port_config.h", "leveldb-<(ldbversion)/port/port_stdcxx.h", "leveldb-<(ldbversion)/port/thread_annotations.h", "leveldb-<(ldbversion)/table/block_builder.cc",