swig/Lib/ruby/rubyapi.swg
Gonzalo Garramuno 801fda2b00 Moved Init_stack() declaration over to rubyapi to
avoid potential C++ issues.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9844 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-06-02 10:24:23 +00:00

35 lines
792 B
Text

/* -----------------------------------------------------------------------------
* 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
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