summaryrefslogtreecommitdiff
path: root/ext/dl/mkcallback.rb
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-06 18:07:10 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-06 18:07:10 +0000
commitdca41072d39248093c84fb29c823c9b06a30724c (patch)
treef6e999222f25bb745bcf0a723069fcefd6aca431 /ext/dl/mkcallback.rb
parent1f0125e4aafceca63b4ce353dbb58e66c1052bd8 (diff)
Added VC++ support thanks to U.Nakamura's patch. [ruby-dev:25644]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/mkcallback.rb')
-rw-r--r--ext/dl/mkcallback.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/dl/mkcallback.rb b/ext/dl/mkcallback.rb
index 0b071d4caa..b5a6889743 100644
--- a/ext/dl/mkcallback.rb
+++ b/ext/dl/mkcallback.rb
@@ -111,18 +111,17 @@ for calltype in CALLTYPES
for n in 0..(MAX_CALLBACK-1)
$out << (<<-EOS)
-PRE_DECL_#{calltype.upcase} static #{DLTYPE[ty][:type]}
+PRE_DECL_#{calltype.upcase} static #{DLTYPE[ty][:type]} MIDST_DECL_#{calltype.upcase}
#{func_name(ty,argc,n,calltype)}(#{(0...argc).collect{|i| "DLSTACK_TYPE stack" + i.to_s}.join(", ")}) POST_DECL_#{calltype.upcase}
{
- VALUE args[#{argc}];
- VALUE ret, cb;
+ VALUE ret, cb#{argc > 0 ? ", args[#{argc}]" : ""};
#{
(0...argc).collect{|i|
" args[%d] = LONG2NUM(stack%d);" % [i,i]
}.join("\n")
}
cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});
- ret = rb_funcall2(cb, cb_call, #{argc}, args);
+ ret = rb_funcall2(cb, cb_call, #{argc}, #{argc > 0 ? 'args' : 'NULL'});
return #{DLTYPE[ty][:conv] ? DLTYPE[ty][:conv] % "ret" : ""};
}