librelist archives

« back to archive

[PATCH] avoid deprecated rb_thread_blocking_region on MRI 2.x

[PATCH] avoid deprecated rb_thread_blocking_region on MRI 2.x

From:
Eric Wong
Date:
2014-02-15 @ 08:25
We've finally figured out how to avoid warnings when building on
C Ruby 2.x
---
 ext/kgio/kgio.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ext/kgio/kgio.h b/ext/kgio/kgio.h
index 66a8705..7c992fb 100644
--- a/ext/kgio/kgio.h
+++ b/ext/kgio/kgio.h
@@ -39,8 +39,7 @@ void kgio_autopush_send(VALUE);
 
 VALUE kgio_call_wait_writable(VALUE io);
 VALUE kgio_call_wait_readable(VALUE io);
-#if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL) && \
-    !defined(HAVE_RB_THREAD_BLOCKING_REGION)
+#if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL) && defined(HAVE_RUBY_THREAD_H)
 #  define KGIO_WITHOUT_GVL(fn,data1,ubf,data2) \
       rb_thread_call_without_gvl((fn),(data1),(ubf),(data2))
 #elif defined(HAVE_RB_THREAD_BLOCKING_REGION)
-- 
Eric Wong