[前][次][番号順一覧][スレッド一覧]

ruby-changes:42752

From: nobu <ko1@a...>
Date: Sat, 30 Apr 2016 10:58:42 +0900 (JST)
Subject: [ruby-changes:42752] nobu:r54826 (trunk): thread_sync.c: define global constants always

nobu	2016-04-30 11:55:18 +0900 (Sat, 30 Apr 2016)

  New Revision: 54826

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54826

  Log:
    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.

  Modified files:
    trunk/thread_sync.c
Index: thread_sync.c
===================================================================
--- thread_sync.c	(revision 54825)
+++ thread_sync.c	(revision 54826)
@@ -1304,12 +1304,8 @@ Init_thread_sync(void) https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L1304
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]