#ifndef Rice__detail__mininode__hpp #define Rice__detail__mininode__hpp #include "ruby.hpp" // TODO: This is silly, autoconf... #undef PACKAGE_NAME #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef PACKAGE_VERSION #include "../config.hpp" // TODO: This is silly, autoconf... #undef PACKAGE_NAME #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef PACKAGE_VERSION #if !defined(HAVE_NODE_H) && !defined(REALLY_HAVE_RUBY_NODE_H) namespace Rice { namespace detail { namespace Mininode { typedef struct RNode { unsigned long flags; void * reserved; union { struct RNode * node; VALUE (*cfunc)(ANYARGS); } u1; union { struct RNode * node; VALUE value; } u2; union { struct RNode * node; } u3; } NODE; #define nd_cfnc u1.cfunc #define nd_rval u2.value /* TODO: No way to know the correct size of node_type */ enum node_type { NODE_FOO, }; extern "C" void rb_add_method(VALUE, ID, NODE *, int); extern "C" NODE *rb_node_newnode(enum node_type, VALUE, VALUE, VALUE); template inline NODE * NEW_NODE(T t, A0 a0, A1 a1, A2 a2) { return rb_node_newnode((node_type)t, (VALUE)a0, (VALUE)a1, (VALUE)a2); } #ruby <