summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-15 21:26:36 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-15 21:26:36 +0000
commite1807e59951d4280895dd3f2c2fc4a774ad3fe6a (patch)
treed29ced7c41794a2b28b8ebae88d88877cc1dbb1a
parent4bfea99d1131482b6f28b5dd8d0a622de9231156 (diff)
* thread_pthread.c (numberof): renamed from ARRAY_SIZE() because
other all files use numberof(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--thread_pthread.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 32dfc86b70..14c41aad7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar 15 14:17:55 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (numberof): renamed from ARRAY_SIZE() because
+ other all files use numberof().
+
Say Mar 15 01:33:00 2013 Charles Oliver Nutter <headius@headius.com>
* test/ruby/test_lazy_enumerator.rb (TestLazyEnumerator#test_drop_while):
diff --git a/thread_pthread.c b/thread_pthread.c
index 4187cf00db..bed9452a28 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -64,8 +64,8 @@ static pthread_t timer_thread_id;
# define USE_SLEEPY_TIMER_THREAD 0
#endif
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#ifndef numberof
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
#endif
static void
@@ -1327,7 +1327,7 @@ timer_thread_sleep(rb_global_vm_lock_t* gvl)
}
else {
/* wait (infinite) */
- result = poll(pollfds, ARRAY_SIZE(pollfds), -1);
+ result = poll(pollfds, numberof(pollfds), -1);
}
if (result == 0) {