diff options
Diffstat (limited to 'share/swig/2.0.11/ruby/rubyapi.swg')
-rw-r--r-- | share/swig/2.0.11/ruby/rubyapi.swg | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/share/swig/2.0.11/ruby/rubyapi.swg b/share/swig/2.0.11/ruby/rubyapi.swg new file mode 100644 index 0000000..e007757 --- /dev/null +++ b/share/swig/2.0.11/ruby/rubyapi.swg @@ -0,0 +1,36 @@ +/* ----------------------------------------------------------------------------- + * Ruby API portion that goes into the runtime + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGINTERN VALUE +SWIG_Ruby_AppendOutput(VALUE target, VALUE o) { + if (NIL_P(target)) { + target = o; + } else { + if (TYPE(target) != T_ARRAY) { + VALUE o2 = target; + target = rb_ary_new(); + rb_ary_push(target, o2); + } + rb_ary_push(target, o); + } + return target; +} + +/* For ruby1.8.4 and earlier. */ +#ifndef RUBY_INIT_STACK + RUBY_EXTERN void Init_stack(VALUE* addr); +# define RUBY_INIT_STACK \ + VALUE variable_in_this_stack_frame; \ + Init_stack(&variable_in_this_stack_frame); +#endif + + +#ifdef __cplusplus +} +#endif + |