diff options
author | 2015-04-17 12:56:56 -0700 | |
---|---|---|
committer | 2015-04-17 12:56:56 -0700 | |
commit | 4f558f536c1bfe523e0dd0250420785d54dcc326 (patch) | |
tree | 4b16198dc80970d4155526c23f033a0cf6ea98f6 | |
parent | 3d3a65da84a2a0da7be392847bf971387dff2e00 (diff) | |
parent | e8696fb2864a01bb3fd568323466485d2b96b12d (diff) |
Merge pull request #1297 from yugui/fix/header
Avoid implicit function declarations
-rw-r--r-- | src/ruby/ext/grpc/rb_completion_queue.c | 9 | ||||
-rw-r--r-- | src/ruby/ext/grpc/rb_grpc.c | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c index e2c9b85661..3cf6c313ee 100644 --- a/src/ruby/ext/grpc/rb_completion_queue.c +++ b/src/ruby/ext/grpc/rb_completion_queue.c @@ -33,7 +33,8 @@ #include "rb_completion_queue.h" -#include <ruby.h> +#include <ruby/ruby.h> +#include <ruby/thread.h> #include <grpc/grpc.h> #include <grpc/support/time.h> @@ -52,14 +53,16 @@ typedef struct next_call_stack { } next_call_stack; /* Calls grpc_completion_queue_next without holding the ruby GIL */ -static void *grpc_rb_completion_queue_next_no_gil(next_call_stack *next_call) { +static void *grpc_rb_completion_queue_next_no_gil(void *param) { + next_call_stack *const next_call = (next_call_stack*)param; next_call->event = grpc_completion_queue_next(next_call->cq, next_call->timeout); return NULL; } /* Calls grpc_completion_queue_pluck without holding the ruby GIL */ -static void *grpc_rb_completion_queue_pluck_no_gil(next_call_stack *next_call) { +static void *grpc_rb_completion_queue_pluck_no_gil(void *param) { + next_call_stack *const next_call = (next_call_stack*)param; next_call->event = grpc_completion_queue_pluck(next_call->cq, next_call->tag, next_call->timeout); return NULL; diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index 70a28ddc17..699548b940 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -34,7 +34,8 @@ #include "rb_grpc.h" #include <math.h> -#include <ruby.h> +#include <ruby/ruby.h> +#include <ruby/vm.h> #include <sys/time.h> #include <grpc/grpc.h> @@ -249,7 +250,7 @@ static void Init_grpc_time_consts() { id_tv_nsec = rb_intern("tv_nsec"); } -static void grpc_rb_shutdown(void *vm) { grpc_shutdown(); } +static void grpc_rb_shutdown(ruby_vm_t *vm) { grpc_shutdown(); } /* Initialize the GRPC module structs */ |