mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
rename rr_define macros to something more sane
This commit is contained in:
parent
b251a0b83a
commit
8575115f0a
3 changed files with 6 additions and 6 deletions
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <ruby.h>
|
||||
|
||||
#define RR_DEFINE_METHOD(klass, name, impl, argc) rb_define_method(klass, name, (VALUE(*)(...))impl, argc)
|
||||
#define RR_DEFINE_SINGLETON_METHOD(object, name, impl, argc) rb_define_singleton_method(object, name, (VALUE(*)(...))impl, argc)
|
||||
#define rr_define_method(klass, name, impl, argc) rb_define_method(klass, name, (VALUE(*)(...))impl, argc)
|
||||
#define rr_define_singleton_method(object, name, impl, argc) rb_define_singleton_method(object, name, (VALUE(*)(...))impl, argc)
|
||||
|
||||
VALUE rr_define_class(const char *name, VALUE superclass = rb_cObject);
|
||||
VALUE rr_str_to_perl_case(VALUE str);
|
||||
|
|
|
@ -7,8 +7,8 @@ using namespace v8;
|
|||
|
||||
void rr_init_script() {
|
||||
VALUE Script = rr_define_class("Script");
|
||||
RR_DEFINE_SINGLETON_METHOD(Script, "new", v8_script_new, 1);
|
||||
RR_DEFINE_METHOD(Script, "Run", v8_script_Run, 0);
|
||||
rr_define_singleton_method(Script, "new", v8_script_new, 1);
|
||||
rr_define_method(Script, "Run", v8_script_Run, 0);
|
||||
}
|
||||
|
||||
VALUE v8_script_new(VALUE self, VALUE source) {
|
||||
|
|
|
@ -7,8 +7,8 @@ using namespace v8;
|
|||
|
||||
void rr_init_str() {
|
||||
VALUE String = rr_define_class("String");
|
||||
RR_DEFINE_SINGLETON_METHOD(String, "new", v8_str_new, 1);
|
||||
RR_DEFINE_METHOD(String, "to_s", v8_str_to_s, 0);
|
||||
rr_define_singleton_method(String, "new", v8_str_new, 1);
|
||||
rr_define_method(String, "to_s", v8_str_to_s, 0);
|
||||
}
|
||||
|
||||
VALUE v8_str_new(VALUE clazz, VALUE str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue