Closed programmingkidx closed 1 year ago
I wasn't sure if I should include changes to generated files so I will include them here.
@programmingkidx instead of attaching a patch could you push a commit?
edit: doing so for you
Is there anything else stopping this pull request from being merged?
@tmc look good?
This is the error I see when I try to build a program with this commit in place:
macdriver/core/core_objc.gen.go:4960:2: x redeclared in this block
macdriver/core/core_objc.gen.go:4957:7: other declaration of x
macdriver/core/core_objc.gen.go:4966:10: cannot convert x (variable of type gen_NSObject) to type C.uint
I traced the issue to a method called ProvideImageDataBytesPerRowOrigin(). According to the documentation there is no method with this name. There is one called provideImageData:bytesPerRow:origin::size::userInfo:. I'm guessing this is a bug.
My first idea to fix this issue was to open the json file for NSObject and change the argument's name from x to x1. Problem is there is no json file.
I then did a grep search. It showed ProvideImageDataBytesPerRowOrigin to only be in the core/core_objc.gen.go file, so this means I am not sure where this method comes from.
@tmc Any idea where the ProvideImageDataBytesPerRowOrigin() method comes from?
I found where ProvideImageDataBytesPerRowOrigin() comes from. It is from api/objectivec/nsobject.objc.json. I fixed the problem by changing the name of the receiver variable.
The current problem with this pull request is with a method called preservationPriorityForTag:. This is the error I see:
macdriver/cocoa/cocoa_objc.gen.go:742:3: error: 'preservationPriorityForTag:' is unavailable: not available on macOS preservationPriorityForTag: tag];
This is an issue with the API_UNAVAILABLE() macro. MacDriver does not currently have a system in place to handle this situation.
Not sure how this issue fell out of the documented change proposed. Maybe that it opened up new methods to be supported that introduced these errors? Anyway, I made sure these types are supported in darwinkit, so I'm closing this PR. Thanks!
A lot of methods are skipped by the wrapper generation system because the type they return on not in the mapType() function. To increase the number of Objective-C methods that are wrapped this patch adds support for these types: