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:
parent
69a248a073
commit
b00dfcca17
2 changed files with 14 additions and 1 deletions
|
@ -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>
|
Thu Nov 25 10:03:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* test/win32ole/test_err_in_callback.rb (teardown): remove tmp file
|
* test/win32ole/test_err_in_callback.rb (teardown): remove tmp file
|
||||||
|
|
|
@ -128,8 +128,16 @@ FUNC_#{calltype.upcase}(#{func_name(ty,argc,n,calltype)})(#{(0...argc).collect{|
|
||||||
{
|
{
|
||||||
VALUE ret, cb#{argc > 0 ? ", args[#{argc}]" : ""};
|
VALUE ret, cb#{argc > 0 ? ", args[#{argc}]" : ""};
|
||||||
#{
|
#{
|
||||||
|
sizeof_voidp = [""].pack('p').size
|
||||||
|
sizeof_long = [0].pack('l!').size
|
||||||
(0...argc).collect{|i|
|
(0...argc).collect{|i|
|
||||||
|
if sizeof_voidp == sizeof_long
|
||||||
" args[%d] = LONG2NUM(stack%d);" % [i,i]
|
" 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")
|
}.join("\n")
|
||||||
}
|
}
|
||||||
cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});
|
cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue