Skip to content

Commit 914c6b3

Browse files
author
ideawu
committed
Fix Xcode 9, iOS SDK 11 compile issue
1 parent df9d131 commit 914c6b3

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ChangeLog

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- Upgrade leveldb to version 1.20, fix MANIFEST file too large issue(2017-09-25)
55
* Incompatible changes:
66
- The SSDB_KEY_LEN_MAX limit will be applied to KV, as described in docs(2017-11-08)
7+
* Bug fixes:
8+
- Fix Xcode 9, iOS SDK 11 compile issue(2017-11-20)
79
* 1.9.5
810
* New features:
911
- C++ SDK add disconnected() method(2017-08-29)

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ ios:
2222
cd "${LEVELDB_PATH}"; make clean; CXXFLAGS=-stdlib=libc++ ${MAKE} PLATFORM=IOS
2323
cd "${SNAPPY_PATH}"; make clean; make -f Makefile-ios
2424
mkdir -p ios
25-
mv ${LEVELDB_PATH}/libleveldb-ios.a ${SNAPPY_PATH}/libsnappy-ios.a ios/
25+
mv ${LEVELDB_PATH}/out-ios-universal/libleveldb.a ios/libleveldb-ios.a
26+
mv ${SNAPPY_PATH}/libsnappy-ios.a ios/
2627
cd src/util; make clean; ${MAKE} -f Makefile-ios
2728
cd src/ssdb; make clean; ${MAKE} -f Makefile-ios
2829

src/ssdb/ssdb.h

+6
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ class SSDB{
4949
virtual int incr(const Bytes &key, int64_t by, int64_t *new_val, char log_type=BinlogType::SYNC) = 0;
5050
virtual int multi_set(const std::vector<Bytes> &kvs, int offset=0, char log_type=BinlogType::SYNC) = 0;
5151
virtual int multi_del(const std::vector<Bytes> &keys, int offset=0, char log_type=BinlogType::SYNC) = 0;
52+
// fix iOS 11 issue
53+
#ifdef setbit
54+
#define setbit_ setbit
55+
#undef setbit
5256
virtual int setbit(const Bytes &key, int bitoffset, int on, char log_type=BinlogType::SYNC) = 0;
57+
#define setbit setbit_
58+
#endif
5359
virtual int getbit(const Bytes &key, int bitoffset) = 0;
5460

5561
virtual int get(const Bytes &key, std::string *val) = 0;

0 commit comments

Comments
 (0)