-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove c/winapi and rename some windows types (#5448)
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.
- Loading branch information
Showing
5 changed files
with
26 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lib LibC | ||
alias DWORD = UInt32 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lib LibC | ||
alias LPSTR = Char* | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require "c/win_nt" | ||
require "c/int_safe" | ||
|
||
lib LibC | ||
fun GetLastError : DWORD | ||
|
||
FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100_u32 | ||
FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200_u32 | ||
FORMAT_MESSAGE_FROM_STRING = 0x00000400_u32 | ||
FORMAT_MESSAGE_FROM_HMODULE = 0x00000800_u32 | ||
FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000_u32 | ||
FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000_u32 | ||
|
||
fun FormatMessageA(dwFlags : DWORD, lpSource : Void*, dwMessageId : DWORD, dwLanguageId : DWORD, | ||
lpBuffer : LPSTR, nSize : DWORD, arguments : Void*) : DWORD | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters