File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 5
5
#include " leveldb/c.h"
6
6
7
7
#include < stdlib.h>
8
+ #ifndef WIN32
8
9
#include < unistd.h>
10
+ #endif
9
11
#include " leveldb/cache.h"
10
12
#include " leveldb/comparator.h"
11
13
#include " leveldb/db.h"
Original file line number Diff line number Diff line change 32
32
#define STORAGE_LEVELDB_PORT_PORT_WIN_H_
33
33
34
34
#ifdef _MSC_VER
35
+ #if !(_MSC_VER >= 1900)
35
36
#define snprintf _snprintf
37
+ #endif
36
38
#define close _close
37
39
#define fread_unlocked _fread_nolock
40
+ #ifdef _WIN64
41
+ #define ssize_t int64_t
42
+ #else
43
+ #define ssize_t int32_t
44
+ #endif
38
45
#endif
39
46
40
47
#include < string>
Original file line number Diff line number Diff line change @@ -761,14 +761,16 @@ uint64_t Win32Env::NowMicros()
761
761
static Status CreateDirInner ( const std::string& dirname )
762
762
{
763
763
Status sRet ;
764
- DWORD attr = ::GetFileAttributes (dirname.c_str ());
764
+ std::wstring dirnameW;
765
+ ToWidePath (dirname, dirnameW);
766
+ DWORD attr = ::GetFileAttributesW (dirnameW.c_str ());
765
767
if (attr == INVALID_FILE_ATTRIBUTES) { // doesn't exist:
766
768
std::size_t slash = dirname.find_last_of (" \\ " );
767
769
if (slash != std::string::npos){
768
770
sRet = CreateDirInner (dirname.substr (0 , slash));
769
771
if (!sRet .ok ()) return sRet ;
770
772
}
771
- BOOL result = ::CreateDirectory (dirname .c_str (), NULL );
773
+ BOOL result = ::CreateDirectoryW (dirnameW .c_str (), NULL );
772
774
if (result == FALSE ) {
773
775
sRet = Status::IOError (dirname, " Could not create directory." );
774
776
return sRet ;
You can’t perform that action at this time.
0 commit comments