diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 02:55:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 02:55:18 +0000 |
commit | 13d62659cecf5434d5d7498d6133b1db8a63d050 (patch) | |
tree | eb3c4100d6aa752daf07e8b56841b5158de8e546 /thread_sync.c | |
parent | 44af023d44decaa58225304176898663734af07b (diff) | |
download | bundler-13d62659cecf5434d5d7498d6133b1db8a63d050.tar.gz |
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
Diffstat (limited to 'thread_sync.c')
-rw-r--r-- | thread_sync.c | 8 |
1 files 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); |