зеркало из https://github.com/github/ruby.git
Set static IDs to same name variables
This commit is contained in:
Родитель
2ae35ad766
Коммит
b3de25dfee
59
process.c
59
process.c
|
@ -9123,45 +9123,46 @@ InitVM_process(void)
|
|||
void
|
||||
Init_process(void)
|
||||
{
|
||||
id_in = rb_intern_const("in");
|
||||
id_out = rb_intern_const("out");
|
||||
id_err = rb_intern_const("err");
|
||||
id_pid = rb_intern_const("pid");
|
||||
id_uid = rb_intern_const("uid");
|
||||
id_gid = rb_intern_const("gid");
|
||||
id_close = rb_intern_const("close");
|
||||
id_child = rb_intern_const("child");
|
||||
#define define_id(name) id_##name = rb_intern_const(#name)
|
||||
define_id(in);
|
||||
define_id(out);
|
||||
define_id(err);
|
||||
define_id(pid);
|
||||
define_id(uid);
|
||||
define_id(gid);
|
||||
define_id(close);
|
||||
define_id(child);
|
||||
#ifdef HAVE_SETPGID
|
||||
id_pgroup = rb_intern_const("pgroup");
|
||||
define_id(pgroup);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
id_new_pgroup = rb_intern_const("new_pgroup");
|
||||
define_id(new_pgroup);
|
||||
#endif
|
||||
id_unsetenv_others = rb_intern_const("unsetenv_others");
|
||||
id_chdir = rb_intern_const("chdir");
|
||||
id_umask = rb_intern_const("umask");
|
||||
id_close_others = rb_intern_const("close_others");
|
||||
id_nanosecond = rb_intern_const("nanosecond");
|
||||
id_microsecond = rb_intern_const("microsecond");
|
||||
id_millisecond = rb_intern_const("millisecond");
|
||||
id_second = rb_intern_const("second");
|
||||
id_float_microsecond = rb_intern_const("float_microsecond");
|
||||
id_float_millisecond = rb_intern_const("float_millisecond");
|
||||
id_float_second = rb_intern_const("float_second");
|
||||
id_GETTIMEOFDAY_BASED_CLOCK_REALTIME = rb_intern_const("GETTIMEOFDAY_BASED_CLOCK_REALTIME");
|
||||
id_TIME_BASED_CLOCK_REALTIME = rb_intern_const("TIME_BASED_CLOCK_REALTIME");
|
||||
define_id(unsetenv_others);
|
||||
define_id(chdir);
|
||||
define_id(umask);
|
||||
define_id(close_others);
|
||||
define_id(nanosecond);
|
||||
define_id(microsecond);
|
||||
define_id(millisecond);
|
||||
define_id(second);
|
||||
define_id(float_microsecond);
|
||||
define_id(float_millisecond);
|
||||
define_id(float_second);
|
||||
define_id(GETTIMEOFDAY_BASED_CLOCK_REALTIME);
|
||||
define_id(TIME_BASED_CLOCK_REALTIME);
|
||||
#ifdef HAVE_TIMES
|
||||
id_TIMES_BASED_CLOCK_MONOTONIC = rb_intern_const("TIMES_BASED_CLOCK_MONOTONIC");
|
||||
id_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID = rb_intern_const("TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID");
|
||||
define_id(TIMES_BASED_CLOCK_MONOTONIC);
|
||||
define_id(TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID);
|
||||
#endif
|
||||
#ifdef RUSAGE_SELF
|
||||
id_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID = rb_intern_const("GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID");
|
||||
define_id(GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID);
|
||||
#endif
|
||||
id_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID = rb_intern_const("CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID");
|
||||
define_id(CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID);
|
||||
#ifdef __APPLE__
|
||||
id_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC = rb_intern_const("MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC");
|
||||
define_id(MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC);
|
||||
#endif
|
||||
id_hertz = rb_intern_const("hertz");
|
||||
define_id(hertz);
|
||||
|
||||
InitVM(process);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче