00001 #ifndef Exc_Ruby__ruby_hacks__hpp_
00002 #define Exc_Ruby__ruby_hacks__hpp_
00003
00009
00010 #include <version.h>
00011 #include <ruby.h>
00012
00013
00014 #undef TYPE
00015
00017
00018
00019 extern "C" typedef VALUE (*RUBY_VALUE_FUNC)(VALUE);
00020
00021
00022
00023
00024
00025 #if defined(RUBY_METHOD_FUNC)
00026 # undef RUBY_METHOD_FUNC
00027 # if RUBY_VERSION_CODE <= 166
00028 extern "C" typedef VALUE (*RUBY_METHOD_FUNC)();
00029 # else
00030 extern "C" typedef VALUE (*RUBY_METHOD_FUNC)(ANYARGS);
00031 # endif
00032 #endif
00033
00034
00035 #if RUBY_VERSION_CODE < 170
00036 namespace Exc_Ruby
00037 {
00038 extern "C" typedef VALUE
00039 (*Rb_Protect_Signature)(RUBY_VALUE_FUNC, VALUE, int *);
00040 extern "C" typedef void
00041 (*Rb_Gc_Mark_Signature)(VALUE);
00042 extern "C" typedef void
00043 (*Rb_Set_End_Proc_Signature)(void (*)(VALUE), VALUE);
00044 }
00046 # define rb_protect(f, arg, state) \
00047 ((::Exc_Ruby::Rb_Protect_Signature)(rb_protect))(f, arg, state)
00048
00049 # define rb_gc_mark(value) \
00050 ((::Exc_Ruby::Rb_Gc_Mark_Signature)(rb_gc_mark))(value)
00051
00052 # define rb_set_end_proc(f,v) \
00053 ((::Exc_Ruby::Rb_Set_End_Proc_Signature)(rb_set_end_proc))(f, v)
00054 #endif
00055
00056 #endif // Exc_Ruby__ruby_hacks__hpp_
00057