*** empty log message ***
This commit is contained in:
parent
244267de0f
commit
b82e0d2901
|
@ -121,7 +121,7 @@ static OutputIterator wchar_utf8(InputIterator first, InputIterator last, Output
|
|||
|
||||
static void utf8_wchar(const std::string &utf8, std::wstring &wide) {
|
||||
wide.clear();
|
||||
utf8_wchar(utf8.begin(), utf8.end(), std::insert_iterator<std::wstring>(wide, wide.end()));
|
||||
detail::utf8_wchar(utf8.begin(), utf8.end(), std::insert_iterator<std::wstring>(wide, wide.end()));
|
||||
}
|
||||
|
||||
static std::wstring utf8_wchar(const std::string &str) {
|
||||
|
@ -132,7 +132,7 @@ static std::wstring utf8_wchar(const std::string &str) {
|
|||
|
||||
static std::string wchar_utf8(const std::wstring &wide, std::string &utf8) {
|
||||
utf8.clear();
|
||||
wchar_utf8(wide.begin(), wide.end(), std::insert_iterator<std::string>(utf8, utf8.end()));
|
||||
detail::wchar_utf8(wide.begin(), wide.end(), std::insert_iterator<std::string>(utf8, utf8.end()));
|
||||
}
|
||||
|
||||
static std::string wchar_utf8(const std::wstring &str) {
|
||||
|
|
|
@ -57,15 +57,19 @@ namespace
|
|||
|
||||
void throw_exception(const char* thrower)
|
||||
{
|
||||
char *buffer = 0;
|
||||
int err = GetLastError();
|
||||
|
||||
#ifdef _UNICODE
|
||||
#ifdef UNICODE
|
||||
wchar_t *wbuffer = 0;
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_FROM_SYSTEM
|
||||
|FORMAT_MESSAGE_ALLOCATE_BUFFER
|
||||
, 0, err, 0, (LPWSTR)(LPCSTR)&buffer, 0, 0);
|
||||
, 0, err, 0, (LPWCSTR)&wbuffer, 0, 0);
|
||||
std::string tmp_utf8;
|
||||
wchar_utf8(wbuffer, tmp_utf8);
|
||||
char* buffer = tmp_utf8.c_str();
|
||||
#else
|
||||
char* buffer = 0;
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_FROM_SYSTEM
|
||||
|FORMAT_MESSAGE_ALLOCATE_BUFFER
|
||||
|
@ -116,7 +120,7 @@ namespace libtorrent
|
|||
|
||||
assert(access_mask & (GENERIC_READ | GENERIC_WRITE));
|
||||
|
||||
#ifdef _UNICODE
|
||||
#ifdef UNICODE
|
||||
std::wstring wfile_name(utf8_wchar(file_name));
|
||||
HANDLE new_handle = CreateFile(
|
||||
(LPCWSTR)wfile_name.c_str()
|
||||
|
|
Loading…
Reference in New Issue