Skip to content

target: Implement OS version detection for Windows #4585

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 3 commits into from
Mar 1, 2020

Conversation

LemonBoy
Copy link
Contributor

I've followed the direction you've set but building the version word by hand feels a bit awkward, maybe using the major.minor.build_no scheme works better...

Closes #4581

@daurnimator daurnimator added os-windows standard library This issue involves writing Zig code for the standard library. labels Feb 29, 2020
Address review comment by @rocksnest
@andrewrk
Copy link
Member

maybe using the major.minor.build_no scheme works better...

I'm fine with this, if it's what makes sense to use for feature testing. Maybe we can have the WindowsVersion names as "canonical aliases" which are used when parsing and stringifying the target triple.

@andrewrk
Copy link
Member

andrewrk commented Mar 1, 2020

Unless you have an argument not to, let's use the PEB to get the info

@LemonBoy
Copy link
Contributor Author

LemonBoy commented Mar 1, 2020

Unless you have an argument not to, let's use the PEB to get the info

I've already told ya why I don't want to pull this off the PEB, if you feel the need to do so even though there's a perfectly good API for this then feel free to close this PR. I don't want my name on that code.

@daurnimator
Copy link
Contributor

daurnimator commented Mar 1, 2020

I agree with using the Rtl function for this: I'm happy with using the PEB to bypass win32 or an unwanted allocation; but not as much to bypass an ntdll function.

@andrewrk
Copy link
Member

andrewrk commented Mar 1, 2020

I've already told ya why I don't want to pull this off the PEB,

Ah, I see #4585 (comment) now - sorry 'bout that. missed it in my notifications.

OK, ntdll.dll function call is fine by me.

@andrewrk andrewrk merged commit ae99fab into ziglang:master Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os-windows standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement the native operating system version detection for Windows
4 participants