Skip to content
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 header for 64 bits compilation #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

@@ -44,7 +44,7 @@ static inline void
FormatSystemErrorCode(int code, char* error, size_t maxlength) {
#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