Skip to content
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

mangled parameters or return values #31

Open
patrickhno opened this issue May 21, 2014 · 0 comments
Open

mangled parameters or return values #31

patrickhno opened this issue May 21, 2014 · 0 comments

Comments

@patrickhno
Copy link

On OSX objc_allocateClassPair parameters or return value gets mangled somehow.
The last output line of this example should be "Test" and not a blank string ""

obj = CFunc::call(CFunc::Pointer, "objc_getClass", 'NSObject')
v = CFunc::Int.new
v.value = 0
klass = CFunc::call(CFunc::Pointer, "objc_allocateClassPair", obj, 'Test', v)
name = CFunc::call(CFunc::Pointer, "class_getName", obj)
puts name.to_s.inspect  # => "NSObject"
name = CFunc::call(CFunc::Pointer, "class_getName", klass)
puts name.to_s.inspect  # => ""

Both ffi library itself using c and ruby ffi behaves as expected with the exact same sequence of calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant