diff --git a/thread_sync.c b/thread_sync.c index efa6208f5d..d7975beeff 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -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);