#set_ctypes using newer ruby features to simplify its implementation.
* test/dl/test_c_struct_entry.rb (class DL): Test to verify
refactoring.
Reviewed by Aaron Patterson.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to remove unused variables and simplify using newer ruby features.
* test/dl/test_c_struct_entry.rb: Test to validate refactoring
Reviewed by Aaron Patterson
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
#set_types to reuse DL::CUnionEntity::size
* test/dl/test_c_union_entity.rb: Added test
Reviewed by Aaron Paterson
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
return the size of the union.
* test/dl/test_c_union_entity.rb: Test for DL::CUnionEntity::size
Reviewed by Aaron Patterson
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/dl/test_base.rb (libc_so, libm_so): on Solaris, remove libc
and libm version numbers for detecting default libc and libm.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
workaround to mark wrapped object. this is not a true fix,
because [Bug #4929] is caused by the interface design of DL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
FreeBSD (at least 7.2 to 7.2) calls nsdispatch(3) when it calls
getaddrinfo(3). And nsdispatch(3) doesn't call dlerror(3) even if
it calls _nss_cache_cycle_prevention_function with dlsym(3).
So our DL::Handle#sym must call dlerror(3) before call dlsym.
In general uses of dlerror(3) should call it before use it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Windows, because this tests a platform specific feature and it'll never be
supported on ruby on Windows.
* test/ruby/test_dir_m17n.rb (TestDir_M17N#test_filename_extutf8_invalid,
TestDir_M17N#test_filename_as_bytes_extutf8): ditto.
* test/open-uri/test_open-uri.rb
(TestOpenURI#test_find_proxy_case_sensitive_env): ditto.
* test/dl/test_handle.rb (DL::TestHandle#test_NEXT,
DL::TestHandle#test_DEFAULT): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
work on x86_64 due to the design of DL2.
* test/dl/test_func.rb (DL::TestFunc#test_{sinf,sin): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
when calling import_symbol or import_function without calling
dlload. Thanks nobu! [ruby-core:30996]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to defend from GC.
* test/dl/test_func.rb (test_string): add test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
by supporting "uint" types in the c parser. [ruby-core:29750]
* test/dl/test_cparser.rb: adding a test for "uint" changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because RTLD_DEFAULT and RTLD_NEXT don't work well on windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/dl/test_import.rb (DL::LIBC::BoundQsortCallback): renamed
to get rid of overwriting warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Linux and Darwin's RTLD_NEXT searchs second occurrence of the function.
But FreeBSD and NetBSD's RTLD_NEXT searchs in libraries loaded after dl.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dl/function.c: DL::Function now uses libffi
* ext/dl/cfunc.c (rb_dl_set_last_error): set to non static so errors
can be exposed.
* ext/dl/closure.c: DL::Closure will now be used in place of
ext/dl/callback/*.
* ext/dl/dl.c: legacy callbacks removed in favor of libffi
* ext/dl/dl_converions.(c,h): used for converting ruby types to FFI
types.
* ext/dl/callback/*: replaced by libffi callbacks.
* ext/dl/lib/dl/callback.rb: Converting internal callbacks to use
DL::Closure
* ext/dl/lib/dl/closure.rb: Ruby parts of the new DL::Closure object
* ext/dl/lib/dl/import.rb: More conversion to use DL::Closure object
* ext/dl/lib/dl/value.rb (ruby2ffi): adding private method for
DL::CPtr to ffi value conversion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
keep a reference to the object it's wrapping
* test/dl/test_func.rb use standard test methods
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e