-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove c/winapi and rename some windows types #5448
Conversation
winapi.cr used old and outdated conventions regarding the windows porting effort. It is deleted, and the definitions in it which are used are moved to files corresponding to the windows header they are defined in. Some windows types are also renamed to retain their capitalisation from Microsoft's headers.
1afb3a2
to
043db7a
Compare
@@ -0,0 +1,3 @@ | |||
lib LibC | |||
alias LPSTR = Char* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it wise to alias LPSTR as a pointer to Char
?
In WinNT.h
it is declared as a pointer of CHAR
which is a 1-byte character only.
Reading a pointer of Char
from windows API shouldn't be any issue but it will fail if it is populated from Crystal with multibyte characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should probably better be
alias CHAR = UInt8
alias LPSTR = CHAR*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Char is LibC::Char which is UInt8...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed that. Still, would it make sense to add an uppercase alias CHAR
as in WinNT.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not duplicate all the existing libc constants just in upper case just for windows.
Ping, this is a really tiny change that affects only windows, this should be simple to review. |
winapi.cr used old and outdated conventions regarding the windows porting effort. It is deleted, and the definitions in it which are used are moved to files corresponding to the windows header they are defined in. Some windows types are also renamed to retain their capitalisation from Microsoft's headers.
winapi.cr used old and outdated conventions regarding the windows porting effort. It is deleted, and the definitions in it which are used are moved to files corresponding to the windows header they are defined in.
Some windows types are also renamed to retain their capitalisation from Microsoft's headers.