Граф коммитов

266 Коммитов

Автор SHA1 Сообщение Дата
nobu 24b6863f79 fiddle: check assembler
* ext/fiddle/extconf.rb: requires assembler for src/win{32,64}.S.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-11 03:54:45 +00:00
nobu 463856a7c4 fiddle: fix for old VC
* 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
2015-01-11 03:54:35 +00:00
nobu 544651a2fb cparser.rb: limit word number
* 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
2015-01-03 09:53:30 +00:00
hsbt 1ba6e8868c * ext/fiddle/lib/fiddle/cparser.rb: r49110 brake Fiddle::Import with
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
2015-01-03 09:23:43 +00:00
svn f661c0be44 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-03 00:54:40 +00:00
hsbt 3afd0f9a91 * ext/fiddle/lib/fiddle/cparser.rb: Support for Fiddle::CParser
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
2015-01-03 00:54:37 +00:00
nobu 5cc1e95be3 fiddle: append libffi config.log
* ext/fiddle/extconf.rb: copy config.log of libffi when failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-30 06:13:33 +00:00
nobu e0c64486ad libffi.mk.tmpl: fix STATICLIB
* ext/fiddle/win32/libffi.mk.tmpl (STATICLIB): fix static library
  name.  [ruby-core:67128]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-25 15:02:12 +00:00
nobu a9f70432d4 extconf.rb: libffi PIC objects
* 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
2014-12-25 12:58:18 +00:00
usa 990a0bb897 * ext/fiddle/win32/libffi-3.2.1-mswin.patch: support mswin32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-25 10:01:41 +00:00
nobu 0a841035df fiddle: depend rules
* 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
2014-12-24 06:58:34 +00:00
nobu 0cd829c339 fiddle: win32/libffi-config.rb
* ext/fiddle/win32/libffi-config.rb: generate necessary files to
  build on mswin.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24 02:29:56 +00:00
usa a54aae45a6 * ext/fiddle/extconf.rb: remove ffitarget.h generated by configure on
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
2014-12-24 00:36:42 +00:00
nobu 840fa8086e fiddle: extlibs
* ext/fiddle/extlibs: libffi-3.2.1 and patch for mswin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-23 13:39:13 +00:00
nobu 132415bf9e extconf.rb: no empty CPP
* 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
2014-12-23 13:07:39 +00:00
nobu 5b6fc3f006 extmk.rb: replace current directory name
* 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
2014-12-23 13:05:47 +00:00
nobu b9ffe579da fiddle: use RMALL
* ext/fiddle/depend (realclean-libffi): use RMALL instead of
  RMDIRS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-23 11:57:11 +00:00
nobu 276065f870 fiddle: clean-libffi
* ext/fiddle/depend (clean-libffi): clean libffi directory.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-23 11:33:54 +00:00
nobu 4c0a560cac extconf.rb: try modversion ff pkg_config succeeded
* 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
2014-12-23 06:22:00 +00:00
nobu b2c4e778ba extconf.rb: libffi on mswin
* 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
2014-12-23 06:21:49 +00:00
nobu 458cffce1a extconf.rb: libffi with libruby
* 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
2014-12-22 03:42:13 +00:00
nobu 055ae0c859 extconf.rb: configure libffi first
* 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
2014-12-22 03:17:36 +00:00
nobu 80036df9e3 fiddle: modversion may be unavailable
* ext/fiddle/extconf.rb: modversion may be unavailable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-21 08:12:18 +00:00
nobu 0c8b964ef7 fiddle: do not disturb other checks
* 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
2014-12-21 07:15:04 +00:00
nobu bade6e467e handle.c: suppress warnings
* 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
2014-12-21 05:51:23 +00:00
nobu 53a7c96417 fiddle: fix build failures
* 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
2014-12-21 05:45:01 +00:00
nobu cfe3357581 handle.c: suppress a warning
* ext/fiddle/handle.c (rb_fiddle_handle_initialize): suppress an
  unused-but-set-variable warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-21 05:26:20 +00:00
nobu 96fc3108b5 fiddle: configure in mflags
* 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
2014-12-20 03:53:05 +00:00
nobu 5856a95191 fiddle: bundled libffi
* ext/fiddle/depend, ext/fiddle/extconf.rb: try to build bundled
  libffi if existing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-20 02:23:00 +00:00
tenderlove 07308c4d30 * ext/dl/*: remove DL as it is replaced by Fiddle.
[Feature #5458] Thanks to Jonan Scheffler <jonanscheffler@gmail.com>
  for this patch

* test/dl/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-31 21:13:09 +00:00
nobu ba0655ebdd ext: protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:29:24 +00:00
nobu 28b9f11d5a protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30 05:25:32 +00:00
nobu 065b6d2b7c fiddle/import.rb: fix typo
* ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof): fix typo,
  SIZEOF_LONG_LON.  [Fix GH-714]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-15 00:43:14 +00:00
nobu ae8c770ba5 fiddle/extconf.rb: supply 0
* 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
2014-06-21 03:54:19 +00:00
nobu dfdb8b7372 fiddle/function.c: fix memory leak on exception
* 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
2014-03-09 04:51:38 +00:00
nobu 1692e54793 fiddle/function.c: check argument size
* ext/fiddle/function.c (initialize): check argument number if the
  temporary buffer exceeds size_t max.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-09 04:51:17 +00:00
nobu ff84a6a2e7 ext/dl, ext/fiddle: fix memory leak
* 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
2014-03-08 04:46:57 +00:00
kazu 4f180097d3 use NUM2SIZET instead of NUM2INT
* ext/dl/dl.c (rb_dl_realloc): use NUM2SIZET instead of NUM2INT.

* ext/fiddle/fiddle.c (rb_fiddle_realloc): ditto.

* ext/dl/dl.c (rb_dl_malloc): use NUM2SIZET instead of NUM2INT.
  Coverity Scan found this bug.

* ext/fiddle/fiddle.c (rb_fiddle_malloc): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-25 14:18:13 +00:00
mame 995d330779 * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
[ruby-core:57599] [Bug #8978].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-29 23:27:14 +00:00
tenderlove 2ee916752c * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
[ruby-core:57599] [Bug #8978].  Thanks mame!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 18:53:23 +00:00
nobu a1a237fb36 ext/fiddle: backward compatibilities
* ext/fiddle/function.c, ext/fiddle/pointer.c: add macros for
  backward compatibilities.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 08:16:44 +00:00
nobu 405ad52ad7 function.c: adjust indent
* ext/fiddle/function.c (parse_keyword_arg_i): adjust indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 08:16:32 +00:00
nobu 7e9bd8f72c ext: real class name
* ext/dl/cptr.c (rb_dlptr_inspect): use real class name, not
  singleton class.

* ext/fiddle/pointer.c (rb_fiddle_ptr_inspect): ditto.

* ext/strscan/strscan.c (strscan_inspect): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:36 +00:00
nobu 9bd672f668 ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 08:11:36 +00:00
charliesome 75f4731f90 * benchmark/bm_so_meteor_contest.rb: [DOC] Fix a few typos
* ext/fiddle/lib/fiddle/import.rb: ditto
* ext/psych/lib/psych.rb: ditto
* ext/psych/lib/psych/nodes/sequence.rb: ditto
* ext/tk/lib/multi-tk.rb: ditto
* ext/tk/lib/tcltk.rb: ditto

Closes GH-490

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-28 08:25:28 +00:00
zzak 6bb201d6d1 * ext/fiddle/*: [DOC] More doc on dlopen and RTLD_DEFAULT from r42186
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26 05:06:57 +00:00
zzak 5cbfd7509c * ext/fiddle/lib/fiddle.rb: [DOC] Document Fiddle.dlopen(nil)
* ext/fiddle/handle.c: [DOC] Document Fiddle::Handle.new(nil)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26 04:11:27 +00:00
nobu 771d31ace2 ext/win32: move
* 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
2013-07-13 03:24:28 +00:00
usa e9ce31bf68 * ext/fiddle/win32/lib/win32/registry.rb
(Win32::Registry::API#make_wstr): same as r41922.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-12 09:11:25 +00:00
usa 7212ee1328 * ext/{dl,fiddle}/win32/lib/win32/registry.rb: hope that the final
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
2013-07-09 08:00:28 +00:00
usa b35c6a429e * ext/{dl,fiddle}/win32/lib/win32/registry.rb (Win32::Regstry#check):
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
2013-07-09 02:06:13 +00:00
usa a189f7f6c8 * ext/{dl,fiddle}/win32/lib/win32/registry.rb: typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09 01:45:57 +00:00
usa b16b5afa24 * ext/{dl,fiddle}/win32/lib/win32/registry.rb
(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
2013-07-09 01:30:47 +00:00
usa abc0b2f10b * ext/{dl,fiddle}/win32/lib/win32/registry.rb
(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
2013-07-09 01:04:05 +00:00
usa d9726121e5 * ext/dl/win32/lib/win32/registry.rb (Win32::Registry.expand_environ):
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
2013-07-09 00:49:44 +00:00
shugo 1f828497d1 * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
when $SAFE is set to 4.  $SAFE=4 is now obsolete.
  [ruby-core:55222] [Feature #8468]

* object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust):
  Kernel#untrusted?, untrust, and trust are now deprecated.
  Their behavior is same as tainted?, taint, and untaint,
  respectively.

* include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED()
  and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(),
  respectively.

* array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c,
  ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c,
  ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c,
  ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c,
  ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c,
  ext/socket/socket.c, ext/socket/udpsocket.c,
  ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c,
  ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c,
  load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c,
  safe.c, string.c, thread.c, transcode.c, variable.c,
  vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for
  $SAFE=4.

* test/dl/test_dl2.rb, test/erb/test_erb.rb,
  test/readline/test_readline.rb,
  test/readline/test_readline_history.rb, test/ruby/test_alias.rb,
  test/ruby/test_array.rb, test/ruby/test_dir.rb,
  test/ruby/test_encoding.rb, test/ruby/test_env.rb,
  test/ruby/test_eval.rb, test/ruby/test_exception.rb,
  test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb,
  test/ruby/test_io.rb, test/ruby/test_method.rb,
  test/ruby/test_module.rb, test/ruby/test_object.rb,
  test/ruby/test_pack.rb, test/ruby/test_rand.rb,
  test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb,
  test/ruby/test_struct.rb, test/ruby/test_thread.rb,
  test/ruby/test_time.rb: remove tests for $SAFE=4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 14:20:51 +00:00
charliesome 2fb8799e6e * ext/fiddle/fiddle.c: fix typo in fiddle doc [Bug #8412]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 12:27:12 +00:00
ktsj 67964f299b * ext/fiddle/extconf.rb: ignore rc version of libffi to fix build failure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 02:42:16 +00:00
nagachika c7d7ff45f1 * ext/dl/lib/dl/func.rb (DL::Function#call): check tainted when
$SAFE > 0.
* ext/fiddle/function.c (function_call): check tainted when $SAFE > 0.
* test/fiddle/test_func.rb (module Fiddle): add test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 11:06:58 +00:00
akr 582ba0a57c * ext/fiddle/depend: New file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-15 13:22:20 +00:00
naruse cddd37aae2 * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 on
Mac OS X and Linux [Bug #3371]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11 07:10:39 +00:00
naruse c0e0a684d7 * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): add missing case:
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
2013-04-11 01:40:11 +00:00
naruse a0f7f29215 * ext/fiddle/extconf.rb: define RUBY_LIBFFI_MODVERSION macro.
* ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 or 1
  with platform and libffi's version. [Bug #3371]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 21:15:37 +00:00
naruse 2570f838da * ext/fiddle/closure.c (initialize): check mprotect's return value.
If mprotect is failed because of PaX or something, its function call
  will cause SEGV.
  http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130401T210301Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 18:35:21 +00:00
kazu dbec401c11 use INT2FIX(0) instead of INT2NUM(0).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05 16:31:19 +00:00
kou 8346f7b2ad * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
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
2012-12-21 14:16:02 +00:00
kou e852838cee * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
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
2012-12-21 14:12:57 +00:00
kou 3fed8bc9a5 * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof):
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
2012-12-21 13:44:44 +00:00
ngoto 48bcb55c41 * ext/fiddle/pointer.c (rb_fiddle_ptr2cptr): fix error message forgotten to be changed from DL to Fiddle.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15 15:04:25 +00:00
ngoto 3e6a624a83 * ext/fiddle/function.c (Fiddle::Function.new): new keyword argument :name to set the name attribute.
* 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
2012-12-11 10:41:00 +00:00
nobu 0e7fd84774 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-10 09:03:17 +00:00
usa f9aa334b5b * ext/fiddle/win32/*: library ports from DL to Fiddle.
* 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
2012-12-10 09:01:27 +00:00
ngoto 97de2b36e9 * ext/fiddle/closure.c (Fiddle::Closure.new): fix typo in documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07 04:39:39 +00:00
ngoto a297576c37 * ext/fiddle/function.c (Fiddle::Function.new): fix typo in documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07 04:35:43 +00:00
ngoto 0bc733d9e3 * ext/fiddle/lib/fiddle/function.rb (Fiddle::Function#name): new
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
2012-12-06 16:21:43 +00:00
ngoto 382217c8b6 * ext/fiddle/lib/fiddle/import.rb (CALL_TYPE_TO_ABI): exclude private constant from RDoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06 14:27:38 +00:00
ngoto b6b8960018 * ext/fiddle/lib/fiddle/types.rb: copied from ext/dl/lib/dl/types.rb
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
2012-12-04 09:08:12 +00:00
ngoto 7b103012dc * ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
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
2012-12-04 09:00:23 +00:00
ngoto 4bb1bfa0ed * ext/fiddle/extconf.rb, ext/fiddle/function.c
(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
2012-11-30 15:57:21 +00:00
nobu e553663cbd value.rb: adjust indent
* ext/fiddle/lib/fiddle/value.rb (Fiddle::ValueUtil#wrap_arg): adjust
  indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30 01:35:13 +00:00
nobu 1459cabe70 value.rb: remove DL
* ext/fiddle/lib/fiddle/value.rb (Fiddle::ValueUtil#wrap_arg): remove
  deprecated require.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30 01:35:08 +00:00
nagachika 7b6e26ae14 * ext/fiddle/closure.c: cosmetic fix for rdoc comment. (fix for r37917)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28 14:55:41 +00:00
zzak 4ed6a88b74 * ext/fiddle/closure.c: Documentation for Fiddle
* ext/fiddle/lib/fiddle/import.rb: ditto
* ext/fiddle/lib/fiddle/value.rb: ditto
* ext/fiddle/lib/fiddle/pack.rb: ditto
* ext/fiddle/lib/fiddle/cparser.rb: ditto
* ext/fiddle/lib/fiddle/struct.rb: ditto
* ext/fiddle/lib/fiddle/function.rb: ditto



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28 02:08:39 +00:00
tenderlove 0713f89944 * ext/fiddle/fiddle.c: adding alignment constants for compatibility
with DL.
* ext/fiddle/fiddle.h: ditto
* ext/fiddle/lib/fiddle/cparser.rb: importing the C parser for DL
  backwards compatibility.
* ext/fiddle/lib/fiddle/import.rb: importing the import DSL for DL
  backwards compatibility.
* ext/fiddle/lib/fiddle/pack.rb: importing structure pack for DL
  backwards compatibility.
* ext/fiddle/lib/fiddle/value.rb: ditto
* ext/fiddle/lib/fiddle/struct.rb: importing struct DSL for DL backwards
  compatibility.
* test/dl/test_c_struct_entry.rb: importing tests
* test/dl/test_c_union_entity.rb: ditto
* test/dl/test_cparser.rb: ditto
* test/dl/test_import.rb: ditto
* test/fiddle/test_c_struct_entry.rb: ditto
* test/fiddle/test_c_union_entity.rb: ditto
* test/fiddle/test_cparser.rb: ditto
* test/fiddle/test_import.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28 00:02:49 +00:00
zzak 9c831edbf4 * ext/fiddle/closure.c: Documentation for Fiddle
* ext/fiddle/pointer.c: ditto
* ext/fiddle/function.c: ditto
* ext/fiddle/lib/fiddle.rb: ditto
* ext/fiddle/fiddle.c: ditto
* ext/fiddle/handle.c: ditto



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 23:26:07 +00:00
tenderlove c1fb6a82dc * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handle
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
2012-11-27 19:54:50 +00:00
tenderlove 1eac1cb21e reverting r37881
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 05:59:34 +00:00
tenderlove ab2a7a9346 * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handle
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
2012-11-27 01:38:41 +00:00
kosaki 6074032ae6 * ext/fiddle/extconf.rb: Use an exception instaed of bare abort.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 07:02:25 +00:00
drbrain da39d32f60 * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
reaches end of non-void function" warnings.  [ruby-trunk - Bug #6066]
* re.c (name_to_backref_number):  ditto.
* object.c (rb_Float):  ditto.
* io.c (io_readpartial):  ditto.
* io.c (io_read_nonblock):  ditto.
* pack.c (rb_uv_to_utf8):  ditto.
* proc.c (rb_method_entry_arity):  ditto.
* vm_method.c (rb_f_notimplement):  ditto.
* struct.c (rb_struct_aset_id):  ditto.
* class.c (rb_scan_args):  ditto.
* process.c (rlimit_resource_type):  ditto.
* process.c (rlimit_resource_value):  ditto.
* process.c (p_uid_switch):  ditto.
* process.c (p_gid_switch):  ditto.
* ext/digest/digest.c (rb_digest_instance_update):  ditto.
* ext/digest/digest.c (rb_digest_instance_finish):  ditto.
* ext/digest/digest.c (rb_digest_instance_reset):  ditto.
* ext/digest/digest.c (rb_digest_instance_block_length):  ditto.
* ext/bigdecimal/bigdecimal.c (BigDecimalCmp):  ditto.
* ext/dl/handle.c (rb_dlhandle_close):  ditto.
* ext/tk/tcltklib.c (pending_exception_check0):  ditto.
* ext/tk/tcltklib.c (pending_exception_check1):  ditto.
* ext/tk/tcltklib.c (ip_cancel_eval_core):  ditto.
* ext/tk/tcltklib.c (lib_get_reltype_name):  ditto.
* ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core):  ditto.
* ext/tk/tkutil/tkutil.c (tk_hash_kv):  ditto.
* ext/openssl/ossl_ssl.c (ossl_ssl_session_reused):  ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1):  ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit):  ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve):  ditto.
* ext/fiddle/conversions.c (generic_to_value):  ditto.
* ext/socket/raddrinfo.c (rsock_io_socket_addrinfo):  ditto.
* ext/socket/socket.c (sock_s_getnameinfo):  ditto.
* ext/ripper/eventids2.c (ripper_token2eventid):  ditto.
* cont.c (return_fiber):  ditto.
* dmydln.c (dln_load):  ditto.
* vm_insnhelper.c (vm_search_normal_superclass):  ditto.
* bignum.c (big_fdiv):  ditto.
* marshal.c (r_symlink):  ditto.
* marshal.c (r_symbol):  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13 23:45:37 +00:00
nobu b4288080e7 * ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_t
and intptr_t.  [ruby-core:42460][Feature #5992]
* ext/fiddle/fiddle.c (Init_fiddle): ditto.
* ext/dl/lib/dl/cparser.rb (DL::CParser#parse_ctype): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 05:47:16 +00:00
nobu 34be46a32e * ext/fiddle/closure.c (callback): deal with unsinged integers.
[ruby-core:42458][Bug #5991][Bug #6022]
* ext/fiddle/conversions.c (value_to_generic, generic_to_value):
  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 10:57:05 +00:00
nobu fa65df0d08 * ext/fiddle/closure.c (callback): same as r34506.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 10:52:31 +00:00
nobu d77b2387cf * ext/fiddle/fiddle.c (Init_fiddle): declare in modern style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 15:15:57 +00:00
usa da098bd36e * ext/fiddle/conversions.c (value_to_generic): src is not guranteed as
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
2012-02-09 07:03:07 +00:00
akr 3d25acdccc * io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: use
__linux__ macro for consistency.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15 11:09:47 +00:00
drbrain 87ff4b24ae * ext/.document (fiddle): Remove duplicate entry
* 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
2011-08-15 23:48:59 +00:00
ngoto 4d71d34855 * ext/fiddle/conversions.c (generic_to_value): ffi_arg and ffi_sarg
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
2011-08-09 05:31:47 +00:00
nagachika 60053a0a50 * ext/fiddle/closure.c (callback): use rb_ary_tmp_new() instead of
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
2011-07-28 14:47:51 +00:00
akr 8f59ed795d * ext/fiddle/conversions.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-14 12:04:28 +00:00
tenderlove 20e2c4cb36 * Use _WIN32 rather than checking for windows.h. Thanks Jon Forums!
[ruby-core:33977]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05 03:13:18 +00:00
tenderlove 5c99ee83ad * ext/fiddle/extconf.rb: check for windows.h while building fiddle.
Thanks Jon Forums! [ruby-core:33923]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-27 19:34:00 +00:00
tenderlove 8c196cfba8 * ext/fiddle/extconf.rb: fixing ffi library location on windows.
Thanks Usa! [ruby-core:32930]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-04 15:15:39 +00:00
nobu 6b48289bb7 * ext/fiddle/closure.c (fiddle_closure): embed cif not reference
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
2010-10-30 00:08:30 +00:00
tenderlove 204f8d6820 * ext/fiddle/closure.c : Don't use FFI closure alloc on OpenBSD.
Thanks Jeremy Evans! [ruby-core:32384]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-14 17:15:30 +00:00
nobu 6de2f601af * ext/fiddle/closure.c (closure_data_type),
ext/fiddle/function.c (function_data_type): rb_data_type_t has
  changed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-20 09:23:08 +00:00
nobu 3e8540543e * ext/fiddle/fiddle.h: fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-28 21:22:57 +00:00
tenderlove 50bb2544bb * ext/fiddle/fiddle.h: added FFI type detection to avoid bug in ffi
header files. Thanks Yugui! [ruby-core:30917]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-28 16:26:59 +00:00
mame 3ccd6c0aab * ext/fiddle/extconf.rb: check ffi.h even when pkg-config succeeded.
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
2010-06-15 16:43:46 +00:00
eban 6e10636d32 * ext/fiddle/extconf.rb: De Morgan's laws.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-15 08:16:33 +00:00
eban 423b4d815f * ext/fiddle/extconf.rb: use pkg_config to find ffi.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-15 03:14:34 +00:00
naruse 7eec027f06 * ext/fiddle/closure.c (dealloc): refix workaround r28300.
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
2010-06-13 19:06:25 +00:00
naruse 5422161026 * ext/fiddle/closure.c (dealloc): workaround fix for libffi's
ffi_closure_free. [ruby-dev:41483] [ruby-dev:41214]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-12 15:28:40 +00:00
tenderlove 1684c23496 * ext/fiddle/lib/fiddle.rb: only require DL if it hasn't been required
yet. [ruby-core:30095]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 17:59:46 +00:00
nobu f7050e0e27 * ext/fiddle/function.c (function_call): removed unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-06 09:33:10 +00:00
tenderlove 4bada8b864 * ext/fiddle/*: Adding fiddle library to wrap libffi
* 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
2010-05-06 06:59:24 +00:00