Skip to content

RuntimeModule: make the C++ code actually build on Windows #83132

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

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

Conversation

compnerd
Copy link
Member

Avoid deprecation warnings (open -> _open -> _sopen_s), correct types to types which actually exist (ssize_t is a non-portable type), and add missing includes. This allows the C++ code in the module to build on Windows.

Avoid deprecation warnings (`open` -> `_open` -> `_sopen_s`), correct
types to types which actually exist (`ssize_t` is a non-portable type),
and add missing includes. This allows the C++ code in the module to
build on Windows.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

One bug needs fixing, otherwise LGTM.

OVERLAPPED ovl = {0};
DWORD dwBytesRead = 0;

ovl.Offset = (DWORD)offset;
ovl.OffsetHigh = (DWORD)(offset >> 32);
ovl.Offset = static_cast<DWORD>(offset & 0xffff);
Copy link
Contributor

Choose a reason for hiding this comment

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

Guessing this should be offset & 0xffffffff.

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, yes!

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