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

Replace LARGE_INTEGER and ULARGE_INTEGER with Int64 and UInt64 respectively #1485

Closed
kennykerr opened this issue Mar 9, 2023 · 9 comments
Closed
Assignees
Labels
usability Touch-up to improve the user experience for a language projection

Comments

@kennykerr
Copy link
Contributor

These structs exist only to support very old compilers that don't natively support 64-bit integers.

@KalleOlaviNiemitalo
Copy link

Do they have the same alignment requirements as the native types?

@kennykerr
Copy link
Contributor Author

Yep!

@kennykerr
Copy link
Contributor Author

Both C# and Rust already map this to native compiler types. It would just be nice not to have to do this all over the place.

@KalleOlaviNiemitalo
Copy link

ZwWriteFile defines special semantics for LARGE_INTEGER where HighPart is -1 and LowPart is either FILE_USE_FILE_POINTER_POSITION or FILE_WRITE_TO_END_OF_FILE.

With Win32 WriteFile though, I suppose an application would store those values to the Offset and OffsetHigh members of OVERLAPPED, so it would not become more difficult if LARGE_INTEGER were replaced with Int64.

@KalleOlaviNiemitalo
Copy link

Ok, FILETIME is the 64-bit struct that has a 32-bit alignment requirement.

@mikebattista mikebattista self-assigned this Mar 9, 2023
@mikebattista mikebattista added the usability Touch-up to improve the user experience for a language projection label Mar 9, 2023
@marler8997
Copy link
Contributor

Couldn't this change have an affect on certain ABIs? For example the ABI change that occurs on COM calls when the return type is a native type vs a struct? Maybe there's no examples of this though?

@kennykerr
Copy link
Contributor Author

I don't believe so. Keep in mind that they are unions, not structs. And no, I'm not aware any such cases.

@marler8997
Copy link
Contributor

I don't believe so. Keep in mind that they are unions, not structs.

Didn't you say yourself here that you change the ABI depending on if you're looking at a native typedef?

#636 (comment)

I limit it to those methods that return a type that is both a struct and doesn't have the NativeTypedef attribute. In my parser, structs automatically exclude enums and interfaces.

Are you saying unions are treated like primitive types when determing ABI rather than treated as structs would be?

@kennykerr
Copy link
Contributor Author

I just mean that since these are unions, they have a different layout and alignment to structs. Feel free to take it for a spin to see how MSVC behaves. That's ultimately the litmus test for the calling convention issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Touch-up to improve the user experience for a language projection
Projects
None yet
Development

No branches or pull requests

4 participants