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:
parent
9387ff7315
commit
56695b35de
1 changed files with 7 additions and 1 deletions
|
@ -1227,6 +1227,12 @@ undumpable(VALUE obj)
|
|||
UNREACHABLE;
|
||||
}
|
||||
|
||||
static void
|
||||
alias_global_const(const char *name, VALUE klass)
|
||||
{
|
||||
rb_define_const(rb_cObject, name, klass);
|
||||
}
|
||||
|
||||
static void
|
||||
Init_thread_sync(void)
|
||||
{
|
||||
|
@ -1309,7 +1315,7 @@ Init_thread_sync(void)
|
|||
rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
|
||||
|
||||
#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(Queue);
|
||||
|
|
Loading…
Reference in a new issue