DL::Function and DL::Importer#bind_function ignores abi and name when Fiddle is available
Like Bug #7484, when Fiddle is available, Fiddle's DL wrapper for DL::Function ignores :stdcall ABI. In addition, when creating callback closure, DL::Function wrapped by Fiddle does not set name, and DL::Function#name raises NoMethodError.
Updated by ngoto (Naohisa Goto) about 8 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r38202.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- ext/dl/lib/dl/func.rb (DL::Function#initialize, DL::Function#bind): ABI should be set by using CFunc#calltype even when Fiddle is used. When Fiddle is used and a block is given, name shoud not be ignored. [ruby-core:50562] [Bug #7514]
- ext/dl/lib/dl/import.rb (DL::Importer#bind_function): should respect abi and name when Fiddle is used.
- test/dl/test_func.rb (test_name_with_block): test for "name" method with giving a block.
Updated by usa (Usaku NAKAMURA) about 8 years ago
- Category set to ext
- Status changed from Closed to Assigned
- Assignee set to ngoto (Naohisa Goto)
- Target version set to 2.0.0
Hmm, when using DL::Function, the patch solves the problem.
But, when we try to shift to Fiddle from DL, since Fiddle::Function
does not still have name.
So we can not shift simply.
I think that better solution of this problem is not deceiving DL::Function,
but adding name to Fiddle::Function perfectly.
Goto-san, Aaron, how do you think about this?
In addition, I am actually afflicted by this shift problem now, and this
problem is serious for me.