include <unistd.h> for unlink() #1233

This commit is contained in:
guoling
2024-02-05 19:58:21 +08:00
parent 5b914360f2
commit d7310af125
3 changed files with 7 additions and 1 deletions
+4
View File
@@ -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>;
+1
View File
@@ -35,6 +35,7 @@
# include <sys/file.h>
# include <dirent.h>
# include <cstring>
# include <unistd.h>
using namespace std;
+2 -1
View File
@@ -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;
}