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

ruby-changes:43950

From: nobu <ko1@a...>
Date: Sun, 28 Aug 2016 17:53:29 +0900 (JST)
Subject: [ruby-changes:43950] nobu:r56023 (trunk): thread_sync.c: alias_global_const

nobu	2016-08-28 17:53:22 +0900 (Sun, 28 Aug 2016)

  New Revision: 56023

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

  Log:
    thread_sync.c: alias_global_const
    
    * thread_sync.c (alias_global_const): extract from a macro.

  Modified files:
    trunk/thread_sync.c
Index: thread_sync.c
===================================================================
--- thread_sync.c	(revision 56022)
+++ thread_sync.c	(revision 56023)
@@ -1228,6 +1228,12 @@ undumpable(VALUE obj) https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L1228
 }
 
 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) https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L1315
     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);

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

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