1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/dl/callback/mkcallback.rb (gencallback): shouldn't assume that

VALUE is the same size with long.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2010-11-25 01:31:21 +00:00
parent 69a248a073
commit b00dfcca17
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Nov 25 10:29:55 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/dl/callback/mkcallback.rb (gencallback): shouldn't assume that
VALUE is the same size with long.
Thu Nov 25 10:03:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* test/win32ole/test_err_in_callback.rb (teardown): remove tmp file

View file

@ -128,8 +128,16 @@ FUNC_#{calltype.upcase}(#{func_name(ty,argc,n,calltype)})(#{(0...argc).collect{|
{
VALUE ret, cb#{argc > 0 ? ", args[#{argc}]" : ""};
#{
sizeof_voidp = [""].pack('p').size
sizeof_long = [0].pack('l!').size
(0...argc).collect{|i|
" args[%d] = LONG2NUM(stack%d);" % [i,i]
if sizeof_voidp == sizeof_long
" args[%d] = LONG2NUM(stack%d);" % [i,i]
elsif sizeof_voidp == 8 # should get sizeof_long_long...
" args[%d] = LL2NUM(stack%d);" % [i,i]
else
raise "unknown size of void*"
end
}.join("\n")
}
cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});