about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-05-30 12:31:19 -0700
committerEric Wong <normalperson@yhbt.net>2012-05-30 12:31:19 -0700
commitfa52cc5d0ef7d04b844868e08e2e7ec3c9e3396e (patch)
treed150323dcea2f46c36b37ce38b62331badc5d76d
parenta72e6cd0dd3038ae2a1b5ef94780143f5ab041c0 (diff)
downloadkgio-fa52cc5d0ef7d04b844868e08e2e7ec3c9e3396e.tar.gz
Define rb_thread_blocking_region as a macro for MRI 1.8
to prevent confusing output in tools such as valgrind/gdb.
-rw-r--r--ext/kgio/tryopen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/kgio/tryopen.c b/ext/kgio/tryopen.c
index 6b63673..f8044a5 100644
--- a/ext/kgio/tryopen.c
+++ b/ext/kgio/tryopen.c
@@ -42,7 +42,7 @@ static VALUE nogvl_open(void *ptr)
 #  include "rubysig.h"
 typedef void rb_unblock_function_t(void *);
 typedef VALUE rb_blocking_function_t(void *);
-static VALUE rb_thread_blocking_region(
+static VALUE my_thread_blocking_region(
         rb_blocking_function_t *fn, void *data1,
         rb_unblock_function_t *ubf, void *data2)
 {
@@ -54,6 +54,8 @@ static VALUE rb_thread_blocking_region(
 
         return rv;
 }
+#define rb_thread_blocking_region(fn,data1,ubf,data2) \
+        my_thread_blocking_region((fn),(data1),(ubf),(data2))
 #endif /* ! HAVE_RB_THREAD_BLOCKING_REGION */
 
 /*