* ext/fiddle/win32/libffi-3.2.1-mswin.patch (include/ffi.h.in):
old version VCs did not support long long, use __int64 instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/lib/fiddle/cparser.rb (parse_ctype): limit split word
number as the rest are not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
type_alias
* test/fiddle/test_cparser.rb: added type_alias test for parse_ctype
and parse_struct_signature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to handle rich signatures including parameter names and function
pointer types. Patch by @theryan [fix GH-590]
* test/fiddle/test_cparser.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: make PIC objects if it will be linked as
a shared object eventually. [ruby-core:67128]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/depend: mark PHONY targets, and workaround of
unexpected DEPEND_RULES on mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
mswin, because it's not normal file (cygwin's symlink) and have
system attribute.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: pass CPP only if necessary, should not
make it empty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/extmk.rb (extmake): replace "./" at beginning in LOCAL_LIBS
with the current directory name for values cached in previous
Makefile.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: when pkg_config failed, module version is
not available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: try to compile libffi as mingw on mswin
if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: link libffi with libruby for symbols
provided by ruby on some platforms, e.g. alloca.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: configure libffi for the check requires
the headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: add the local ffi library and header just
before create_makefile, not to disturb other checks.
also prepend the extension path name to the local library name
for static linked ext.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/handle.c (CHECK_DLERROR): suppress warnings for using
the result of an assignment as a condition without parentheses.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/depend (build-libffi): get rid of eventually empty
target for nmake.
* ext/fiddle/extconf.rb: omit stuffs for libffi unless bundled
libffi is found and used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: configure is already in mflags, use
system instead of xsystem which requires a string, and logging
libffi configure output.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
with 3-digit. libffi 3.1 returns just 2-digit.
[ruby-core:62920] [Bug #9897]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/function.c (function_call): fix memory leak when an
exception occurs at argument conversion or the function call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
ext/fiddle/handle.c (fiddle_handle_free),
ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/win32: move from ext/dl and ext/fiddle. since ext/extmk.rb
builds extensions in alphabetical order, compiled?('fiddle') under
ext/dl makes no sense.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
resolution to fix the failure of test-all. and includes Win64
support (fixed a potential bug).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
should report the position of the error.
* ext/{dl,fiddle}/win32/lib/win32/registry.rb
(Win32::Regstry#QueryValue): workaround for test-all crash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Win32::Registry.expand_environ): use suitable encoding for the
string.
* ext/{dl,fiddle}/win32/lib/win32/registry.rb (Win32::Registry#read):
should return REG_SZ, REG_EXPAND_SZ and REG_MULTI_SZ values with
the expected encoding -- assumed as the same encoding of name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Win32::Registry::Error#initialize): use suitable encoding for the
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
use suitable encoding for the string. fixed a test-all error of
r41838.
* ext/fiddle/win32/lib/win32/registry.rb: same changes of r41838 and
this revision of dl's win32/registry.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RUBY_LIBFFI_MODVERSION is not defined (usually on Windows).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
CPtr -> Pointer.
* test/fiddle/test_c_struct_entry.rb
(Fiddle::TestCStructEntity#test_aref_pointer):
Added the test for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
CPtr -> Pointer.
* test/fiddle/test_c_struct_entry.rb
(Fiddle::TestCStructEntity#test_aref_pointer_array):
Added the test for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
CPtr -> Pointer.
* test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
Added the test for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle/lib/fiddle/import.rb (import_function, bind_function): set function name by using the :name keyword argument.
Re-fixes r38243. [ruby-core:50566]
* test/fiddle/test_function.rb (test_name): test for the :name keyword argument and Fiddle::Function#name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dl/win32/extconf.rb: check fiddle. often case dl compiled prior
to fiddle, so this change is no meaning. in most cases, simply
fiddle/win32 overwrite dl/win32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
attribute needed to switch Win32::Registry from DL to Fiddle.
* ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
set function name to the returned Fiddle::Function object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and modified for Fiddle, needed for migration from DL to Fiddle.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
should respect call_type for migration from DL to Fiddle.
[Bug #7484] [ruby-core:50405]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Fiddle::Function::STDCALL): FFI_STDCALL is not a macro, but an enumeration. [ruby-core:50398] [Bug #7483]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to Fiddle::Handle.
* ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
DL::Pointer to Fiddle::Pointer.
* test/fiddle/test_func.rb: relevent tests
* test/fiddle/test_handle.rb: ditto
* test/fiddle/test_pointer.rb: ditto
* ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
* ext/fiddle/extconf.rb: check for dlfcn.h
* ext/fiddle/fiddle.c: add constants for sizeof() things
* ext/fiddle/fiddle.h: include dlfcn.h
* ext/fiddle/function.c: expose a C function for creating new
Fiddle::Function objects.
* ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
* ext/fiddle/lib/fiddle/function.rb: read the pointer from the
function for dl backwards compat.
* test/dl/test_callback.rb: check the addresses of the pointers rather
than their types.
* test/fiddle/helper.rb: remove dependency on dl
* test/fiddle/test_closure.rb: ditto
* test/fiddle/test_fiddle.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to Fiddle::Handle.
* ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
DL::Pointer to Fiddle::Pointer.
* test/fiddle/test_func.rb: relevent tests
* test/fiddle/test_handle.rb: ditto
* test/fiddle/test_pointer.rb: ditto
* ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
* ext/fiddle/extconf.rb: check for dlfcn.h
* ext/fiddle/fiddle.c: add constants for sizeof() things
* ext/fiddle/fiddle.h: include dlfcn.h
* ext/fiddle/function.c: expose a C function for creating new
Fiddle::Function objects.
* ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
* ext/fiddle/lib/fiddle/function.rb: read the pointer from the
function for dl backwards compat.
* test/dl/test_callback.rb: check the addresses of the pointers rather
than their types.
* test/fiddle/helper.rb: remove dependency on dl
* test/fiddle/test_closure.rb: ditto
* test/fiddle/test_fiddle.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
a Bignum if the type is LONG_LONG. it may be a Fixnum if the value
is small.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/fiddle: Complete documentation of Fiddle. Patch by Vincent
Batts. [#5192]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
should be used to handle shorter return value. fix [Bug #3861]
[ruby-core:32504]
* ext/fiddle/closure.c (callback): ditto
* ext/fiddle/conversions.h (fiddle_generic): ditto
* ext/fiddle/conversions.c (value_to_generic): char, short and int
are strictly distinguished on big-endian CPU, e.g. sparc64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
xmalloc() to allocate an array for arguments of callback procedure,
to prevent arguments from being swept by GC. [ruby-core:38546]
[Bug #4929]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
so that the content surely get initialized. [ruby-dev:42480]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
On Debian/lenny, which is a "supported" platform, ffi.h is installed
in /usr/include/i486-linux-gnu/. This causes build error when using
gcc whose target is not i486-linux-gnu.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
don't use ffi_closure_alloc, ffi_prep_closure_loc and
ffi_closure_free on MACOSX and __linux__.
[ruby-dev:41483] [ruby-dev:41214]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/fiddle/*: testing fiddle extension
* ext/dl/lib/dl.rb: Requiring fiddle if it is available
* ext/dl/lib/dl/callback.rb: using Fiddle if it is available
* ext/dl/lib/dl/func.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e