mirror of
https://github.com/Tencent/MMKV.git
synced 2026-10-17 04:30:56 +08:00
include <unistd.h> for unlink() #1233
This commit is contained in:
@@ -49,6 +49,10 @@
|
||||
# endif
|
||||
#endif // MMKV_APPLE
|
||||
|
||||
#ifndef MMKV_WIN32
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace mmkv;
|
||||
using KVHolderRet_t = std::pair<bool, KeyValueHolder>;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
# include <sys/file.h>
|
||||
# include <dirent.h>
|
||||
# include <cstring>
|
||||
# include <unistd.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ void tryResetFileProtection(const string &path) {
|
||||
#ifdef MMKV_APPLE
|
||||
|
||||
#include <copyfile.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace mmkv {
|
||||
|
||||
@@ -77,7 +78,7 @@ bool tryAtomicRename(const char *src, const char *dst) {
|
||||
}
|
||||
}
|
||||
|
||||
unlink(src);
|
||||
::unlink(src);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user