mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix rb_define_global_function to take const VALUE*
It was unable for rb_define_global_function to take VALUE(*)(int argc, const VLAUE *argv, VALUE self) -style function. Test added.
This commit is contained in:
parent
bbe3420cce
commit
83d6487ae5
2 changed files with 71 additions and 1 deletions
|
@ -574,7 +574,7 @@ struct driver0 {
|
|||
template<bool b> struct specific< 0, b> : public engine< 0, VALUE(*)(VALUE)> {};
|
||||
template<bool b> struct specific<-1, b> : public engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)> {
|
||||
using engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)>::define;
|
||||
static inline void define(T m, VALUE(*f)(int argc, const VALUE *argv, VALUE self, VALUE)) { F(m, reinterpret_cast<type *>(f), -1); }
|
||||
static inline void define(T m, VALUE(*f)(int argc, const VALUE *argv, VALUE self)) { F(m, reinterpret_cast<type *>(f), -1); }
|
||||
};
|
||||
template<bool b> struct specific<-2, b> : public engine<-2, VALUE(*)(VALUE, VALUE)> {};
|
||||
/// @endcond
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue