diff options
Diffstat (limited to 'util/env.cc')
-rw-r--r-- | util/env.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/util/env.cc b/util/env.cc index d2f0aef..40e6071 100644 --- a/util/env.cc +++ b/util/env.cc @@ -4,14 +4,28 @@ #include "leveldb/env.h" +// This workaround can be removed when leveldb::Env::DeleteFile is removed. +// See env.h for justification. +#if defined(_WIN32) && defined(LEVELDB_DELETEFILE_UNDEFINED) +#undef DeleteFile +#endif + namespace leveldb { +Env::Env() = default; + Env::~Env() = default; Status Env::NewAppendableFile(const std::string& fname, WritableFile** result) { return Status::NotSupported("NewAppendableFile", fname); } +Status Env::RemoveDir(const std::string& dirname) { return DeleteDir(dirname); } +Status Env::DeleteDir(const std::string& dirname) { return RemoveDir(dirname); } + +Status Env::RemoveFile(const std::string& fname) { return DeleteFile(fname); } +Status Env::DeleteFile(const std::string& fname) { return RemoveFile(fname); } + SequentialFile::~SequentialFile() = default; RandomAccessFile::~RandomAccessFile() = default; @@ -47,7 +61,7 @@ static Status DoWriteStringToFile(Env* env, const Slice& data, } delete file; // Will auto-close if we did not close above if (!s.ok()) { - env->DeleteFile(fname); + env->RemoveFile(fname); } return s; } |