Skip to content

Conversation

@Kenzzer
Copy link
Member

@Kenzzer Kenzzer commented Feb 16, 2024

Ensure to msvc that we want this variable to be narrowed down to an int.

#if defined(KE_WINDOWS)
if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), error, maxlength, nullptr)) {
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), error, (int)maxlength, nullptr)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're doing this, please add:

assert(maxlength <= std::numeric_limits<DWORD>::max());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants