summaryrefslogtreecommitdiff
path: root/thread_sync.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-28 08:53:22 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-28 08:53:22 (GMT)
commit56695b35de2015a3a0efb7b48ae5889787700acd (patch)
tree1f3bf06366123be35b834b2c318075364bb79991 /thread_sync.c
parent9387ff7315b498a6e7c8ab2a4b1582fd6c717524 (diff)
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
Diffstat (limited to 'thread_sync.c')
-rw-r--r--thread_sync.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/thread_sync.c b/thread_sync.c
index efa6208..d7975be 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -1228,6 +1228,12 @@ undumpable(VALUE obj)
}
static void
+alias_global_const(const char *name, VALUE klass)
+{
+ rb_define_const(rb_cObject, name, klass);
+}
+
+static void
Init_thread_sync(void)
{
#if 0
@@ -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);