-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix windows event sink log compilation error with UNICODE preprocessor #1760
Conversation
You got me confused. I see you removed the |
I updated this PR. I'm using #ifdef to check if |
auto succeeded = ::ReportEvent(event_log_handle(), eventlog::get_event_type(msg), eventlog::get_event_category(msg), event_id_, | ||
current_user_sid_.as_sid(), 1, 0, &lp_str, nullptr); | ||
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT | ||
auto buf = std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(formatted.data()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::wstring_convert<std::codecvt_utf8>
is deprecated. Please use details::os::wstr_to_utf8buf(..)
instead. See usage example here.
} | ||
|
||
throw_spdlog_ex(fmt::format("WideCharToMultiByte failed. Last error: {}", ::GetLastError())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong error message in exception. should be “ MultiByteToWideChar”
No description provided.