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

120 Коммитов

Автор SHA1 Сообщение Дата
akr 606274b55d * ext/fiddle/depend: Fix "Wrong mix of special targets" error with
OpenBSD make.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:10:52 +00:00
nobu dc8d595461 libff: fix enable-shared condition
* ext/fiddle/extconf.rb: needs --enable-shared when linked to
  libruby or fiddle.so.  since --with-static-linked-ext does no
  longer link extensions to ruby program with --enable-shared, the
  only combination needs --enable-static is --disable-shared and
  --with-static-linked-ext.  [ruby-dev:48901] [Bug #10960]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-13 02:37:49 +00:00
nobu 22c750bb8d libffi: workaround of VC12 ml
* ext/fiddle/win32/libffi.mk.tmpl: assemble without directory prefix.
  workaround of a bug of VC12 ml, by unak at [ruby-core:67792].
  [ruby-core:67789] [Bug #10780]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-24 15:42:27 +00:00
nobu 8cfce15387 fiddle: --disable-bundled-libffi
* ext/fiddle/extconf.rb: disable bundled libffi if explicitly
  disabled by --disable-bundled-libffi.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-17 10:52:17 +00:00
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