Skip to content

Fixup SourceKit module on Windows #100

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

Merged
merged 1 commit into from
Apr 18, 2019

Conversation

gmittert
Copy link
Contributor

No description provided.

@gmittert gmittert requested a review from benlangmuir as a code owner April 18, 2019 19:48
Copy link
Contributor

@akyrtzi akyrtzi left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I have a small change request, otherwise LGTM.

@gmittert gmittert force-pushed the SourceKitModuleWindows branch from 833da5d to 0868c5f Compare April 18, 2019 20:16
@akyrtzi
Copy link
Contributor

akyrtzi commented Apr 18, 2019

@swift-ci Please test

@akyrtzi akyrtzi merged commit 2dbc232 into swiftlang:master Apr 18, 2019
@gmittert gmittert deleted the SourceKitModuleWindows branch April 18, 2019 23:16
let pid: Int = unsafeBitCast(GetCurrentProcess(), to: Int.self)
#else
let pid: Int = Int(getpid())
#endif
Copy link

Choose a reason for hiding this comment

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

Why we are reimplementing things already in Foundation?

This could simply be:

let pid = Int(ProcessInfo.processInfo.processIdentifier)

Which is already cross-platform.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah fair point, I didn't realize that existed. Plus GetCurrentProcess gives a handle instead of a pid which now that I think about it, is probably the wrong thing to identify a process with. I'll swap it.

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.

3 participants