Commit 77a453a5 authored by Jisi Liu's avatar Jisi Liu

Fix compile errors

parent 4aadcd3c
...@@ -212,15 +212,15 @@ string normalize(string path) { ...@@ -212,15 +212,15 @@ string normalize(string path) {
WCHAR* as_wstring(const string& s) { WCHAR* as_wstring(const string& s) {
int len = ::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), NULL, 0); int len = ::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), NULL, 0);
WCHAR* result = new WCHAR[len + 1]; WCHAR* result = new WCHAR[len + 1];
::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), result.get(), len + 1); ::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), result, len + 1);
result[len] = 0; result[len] = 0;
return result; return result;
} }
void as_wchar_path(const string& path, wstring* wchar_path) { void as_wchar_path(const string& path, wstring* wchar_path) {
scoped_array<WCHAR> wbuf(as_wstring(path)); scoped_array<WCHAR> wbuf(as_wstring(path));
replace_directory_separators(wbuf); replace_directory_separators(wbuf.get());
wchar_path->assign(wbuf); wchar_path->assign(wbuf.get());
} }
bool as_windows_path(const string& path, wstring* result) { bool as_windows_path(const string& path, wstring* result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment