1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

thread_sync.c: alias_global_const

* thread_sync.c (alias_global_const): extract from a macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-08-28 08:53:22 +00:00
parent 9387ff7315
commit 56695b35de

View file

@ -1227,6 +1227,12 @@ undumpable(VALUE obj)
UNREACHABLE; UNREACHABLE;
} }
static void
alias_global_const(const char *name, VALUE klass)
{
rb_define_const(rb_cObject, name, klass);
}
static void static void
Init_thread_sync(void) Init_thread_sync(void)
{ {
@ -1309,7 +1315,7 @@ Init_thread_sync(void)
rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0); rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
#define ALIAS_GLOBAL_CONST(name) \ #define ALIAS_GLOBAL_CONST(name) \
rb_define_const(rb_cObject, #name, rb_c##name) alias_global_const(#name, rb_c##name)
ALIAS_GLOBAL_CONST(Mutex); ALIAS_GLOBAL_CONST(Mutex);
ALIAS_GLOBAL_CONST(Queue); ALIAS_GLOBAL_CONST(Queue);