From 13d62659cecf5434d5d7498d6133b1db8a63d050 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 30 Apr 2016 02:55:18 +0000 Subject: [PATCH] thread_sync.c: define global constants always * thread_sync.c (ALIAS_GLOBAL_CONST): define global constant aliases unconditionally. same constants are not defined at this time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_sync.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/thread_sync.c b/thread_sync.c index 9de9c32965..ed0daa95d3 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -1304,12 +1304,8 @@ Init_thread_sync(void) rb_define_method(rb_cConditionVariable, "signal", rb_condvar_signal, 0); rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0); -#define ALIAS_GLOBAL_CONST(name) do { \ - ID id = rb_intern_const(#name); \ - if (!rb_const_defined_at(rb_cObject, id)) { \ - rb_const_set(rb_cObject, id, rb_c##name); \ - } \ - } while (0) +#define ALIAS_GLOBAL_CONST(name) \ + rb_define_const(rb_cObject, #name, rb_c##name) ALIAS_GLOBAL_CONST(Mutex); ALIAS_GLOBAL_CONST(Queue);