Basic support for Win64 C lib ABI#9387
Merged
bcardiff merged 3 commits intocrystal-lang:masterfrom Jun 3, 2020
Merged
Conversation
To confirm that the newly added file only moves things:
$ git diff -w HEAD~:spec/compiler/codegen/c_abi/c_abi_x86_64_spec.cr spec/compiler/codegen/c_abi/c_abi_spec.cr
Also un-does crystal-lang#5851
This comment has been minimized.
This comment has been minimized.
Member
|
How was this working with C libs before then? |
Member
Author
|
Passing or returning structs never worked. Just that CrSFML never uses either of those so it happened to work, almost everything else doesn't |
Member
Author
|
Wait hold on, I didn't realize that Crystal stdlib itself already has many dependencies on external libs so how do they work? I only saw that libchipmunk didn't work at all without this change and now it does |
Member
Author
|
Looks like all those libs also never require passing structs directly (rather than through a pointer) |
Member
|
Passing a full struct isn't the most common C API indeed IME. Usually you want your caller to allocate them and give you a reference to fill for them. Or you keep the struct to yourself and just give them an opaque reference to pass back to you. |
RX14
approved these changes
Jun 1, 2020
straight-shoota
approved these changes
Jun 2, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also un-does #5851
Based on
See diff (and actually all but the last hunk are no-ops!)
Currently depends on #9384, so skip the first commit in this review.