diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-08-27 11:16:52 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-08-27 15:52:26 +0900 |
commit | ae2dc3f217ba9f181471f39a7e5ce72a28b27c2a (patch) | |
tree | e506115b9dd5c2adb07946763506a5b46d36b5f0 /process.c | |
parent | 78628618da98236fc1bf702079185b36ed394e2a (diff) |
rb_define_hooked_variable now free from ANYARGS
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is
dangerous and should be extinct. This commit uses rb_gvar_getter_t /
rb_gvar_setter_t for rb_define_hooked_variable /
rb_define_virtual_variable which revealed lots of function prototype
inconsistencies. Some of them were literally decades old, going back
to dda5dc00cff334cac373096d444a0fd59e716124.
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -8038,6 +8038,18 @@ rb_clock_getres(int argc, VALUE *argv) } } +static VALUE +get_$CHILD_STATUS(ID _x, VALUE *_y) +{ + return rb_last_status_get(); +} + +static VALUE +get_$PROCESS_ID(ID _x, VALUE *_y) +{ + return get_pid(); +} + VALUE rb_mProcess; static VALUE rb_mProcUID; static VALUE rb_mProcGID; @@ -8054,8 +8066,8 @@ InitVM_process(void) { #undef rb_intern #define rb_intern(str) rb_intern_const(str) - rb_define_virtual_variable("$?", rb_last_status_get, 0); - rb_define_virtual_variable("$$", get_pid, 0); + rb_define_virtual_variable("$?", get_$CHILD_STATUS, 0); + rb_define_virtual_variable("$$", get_$PROCESS_ID, 0); rb_define_global_function("exec", rb_f_exec, -1); rb_define_global_function("fork", rb_f_fork, 0); rb_define_global_function("exit!", rb_f_exit_bang, -1); |