OLD | NEW |
1 diff --git a/Makefile b/Makefile | 1 diff --git a/Makefile b/Makefile |
2 index 344ff29..5e5249e 100644 | 2 index f8903b6..ab4f2aa 100644 |
3 --- a/Makefile | 3 --- a/Makefile |
4 +++ b/Makefile | 4 +++ b/Makefile |
5 @@ -90,7 +90,11 @@ endif # PLATFORM_SHARED_EXT | 5 @@ -90,7 +90,11 @@ endif # PLATFORM_SHARED_EXT |
6 | 6 |
7 all: $(SHARED) $(LIBRARY) | 7 all: $(SHARED) $(LIBRARY) |
8 | 8 |
9 -check: all $(PROGRAMS) $(TESTS) | 9 -check: all $(PROGRAMS) $(TESTS) |
10 +tests: $(TESTS) | 10 +tests: $(TESTS) |
11 + | 11 + |
12 +programs: $(PROGRAMS) | 12 +programs: $(PROGRAMS) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 }; | 61 }; |
62 | 62 |
63 -// AtomicPointer based on <cstdatomic> | 63 -// AtomicPointer based on <cstdatomic> |
64 -#elif defined(LEVELDB_CSTDATOMIC_PRESENT) | 64 -#elif defined(LEVELDB_CSTDATOMIC_PRESENT) |
65 +// AtomicPointer based on <cstdatomic> or <atomic> | 65 +// AtomicPointer based on <cstdatomic> or <atomic> |
66 +#elif defined(LEVELDB_CSTDATOMIC_PRESENT) || defined(LEVELDB_ATOMIC_PRESENT) | 66 +#elif defined(LEVELDB_CSTDATOMIC_PRESENT) || defined(LEVELDB_ATOMIC_PRESENT) |
67 class AtomicPointer { | 67 class AtomicPointer { |
68 private: | 68 private: |
69 std::atomic<void*> rep_; | 69 std::atomic<void*> rep_; |
70 diff --git a/port/port_posix.h b/port/port_posix.h | 70 diff --git a/port/port_posix.h b/port/port_posix.h |
71 index f2b89bf..8976acb 100644 | 71 index f2b89bf..c1c3b5c 100644 |
72 --- a/port/port_posix.h | 72 --- a/port/port_posix.h |
73 +++ b/port/port_posix.h | 73 +++ b/port/port_posix.h |
74 @@ -37,6 +37,14 @@ | 74 @@ -37,6 +37,14 @@ |
75 // See http://code.google.com/p/android/issues/detail?id=39824 | 75 // See http://code.google.com/p/android/issues/detail?id=39824 |
76 #include <endian.h> | 76 #include <endian.h> |
77 #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN) | 77 #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN) |
78 +#elif defined(OS_NACL) | 78 +#elif defined(OS_NACL) |
79 + #include <sys/types.h> | 79 + #include <sys/types.h> |
80 + #if defined(__GLIBC__) | 80 + #if defined(_NEWLIB_VERSION) |
81 + #include <endian.h> | |
82 + #else | |
83 + #include <machine/endian.h> | 81 + #include <machine/endian.h> |
84 + #define PLATFORM_IS_LITTLE_ENDIAN (BYTE_ORDER == LITTLE_ENDIAN) | 82 + #define PLATFORM_IS_LITTLE_ENDIAN (BYTE_ORDER == LITTLE_ENDIAN) |
| 83 + #else |
| 84 + #include <endian.h> |
85 + #endif | 85 + #endif |
86 #else | 86 #else |
87 #include <endian.h> | 87 #include <endian.h> |
88 #endif | 88 #endif |
89 @@ -55,7 +63,7 @@ | 89 @@ -55,7 +63,7 @@ |
90 | 90 |
91 #if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\ | 91 #if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\ |
92 defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\ | 92 defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\ |
93 - defined(OS_ANDROID) || defined(OS_HPUX) | 93 - defined(OS_ANDROID) || defined(OS_HPUX) |
94 + defined(OS_ANDROID) || defined(OS_HPUX) || (defined(OS_NACL) && defined(_NE
WLIB_VERSION)) | 94 + defined(OS_ANDROID) || defined(OS_HPUX) || (defined(OS_NACL) && (defined(_N
EWLIB_VERSION) || defined(__BIONIC__))) |
95 // Use fread/fwrite/fflush on platforms without _unlocked variants | 95 // Use fread/fwrite/fflush on platforms without _unlocked variants |
96 #define fread_unlocked fread | 96 #define fread_unlocked fread |
97 #define fwrite_unlocked fwrite | 97 #define fwrite_unlocked fwrite |
98 diff --git a/util/env_posix.cc b/util/env_posix.cc | 98 diff --git a/util/env_posix.cc b/util/env_posix.cc |
99 index e1cbebd..a385f03 100644 | 99 index e1cbebd..a385f03 100644 |
100 --- a/util/env_posix.cc | 100 --- a/util/env_posix.cc |
101 +++ b/util/env_posix.cc | 101 +++ b/util/env_posix.cc |
102 @@ -27,6 +27,32 @@ | 102 @@ -27,6 +27,32 @@ |
103 #include "util/mutexlock.h" | 103 #include "util/mutexlock.h" |
104 #include "util/posix_logger.h" | 104 #include "util/posix_logger.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 struct flock f; | 143 struct flock f; |
144 memset(&f, 0, sizeof(f)); | 144 memset(&f, 0, sizeof(f)); |
145 @@ -265,6 +294,7 @@ static int LockOrUnlock(int fd, bool lock) { | 145 @@ -265,6 +294,7 @@ static int LockOrUnlock(int fd, bool lock) { |
146 f.l_start = 0; | 146 f.l_start = 0; |
147 f.l_len = 0; // Lock/unlock entire file | 147 f.l_len = 0; // Lock/unlock entire file |
148 return fcntl(fd, F_SETLK, &f); | 148 return fcntl(fd, F_SETLK, &f); |
149 +#endif | 149 +#endif |
150 } | 150 } |
151 | 151 |
152 class PosixFileLock : public FileLock { | 152 class PosixFileLock : public FileLock { |
OLD | NEW |