-
Notifications
You must be signed in to change notification settings - Fork 84
objc: add protocol support #46
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
Conversation
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.
LGTM!
Did you want to discuss my question first or do you agree with my conclusion? |
Sorry I missed that.
Hm, then p, _, _ := purego.SyscallN(objc_getProtocol, uintptr(unsafe.Pointer(n)))
return Protocol(p) Doesn't this SyscallN return a pointer to Protocol instead of a Protocol itself? |
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.
Let's resolve the signature issue
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.
LGTM!
This is needed for ebitengien#2326.
Should the
GetProtocol
function return a pointer to Protocol or just Protocol? The Objective-C runtime returns a pointer however there is never a reason for us to need to dereference this pointer so I thought it best to just remove it.