Support ruby 2.2.0

pull/894/head
mattn 10 years ago
parent 41d524682d
commit b9e1563853
  1. 1
      src/ruby/ext/grpc/extconf.rb
  2. 6
      src/ruby/ext/grpc/rb_grpc.c

@ -77,7 +77,6 @@ end
dir_config('grpc', HEADER_DIRS, LIB_DIRS)
$CFLAGS << ' -std=c89 '
$CFLAGS << ' -Wno-implicit-function-declaration '
$CFLAGS << ' -Wno-pointer-sign '
$CFLAGS << ' -Wno-return-type '

@ -119,12 +119,12 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) {
break;
case T_FLOAT:
if (interval && RFLOAT(time)->float_value < 0.0)
if (interval && RFLOAT_VALUE(time) < 0.0)
rb_raise(rb_eArgError, "%s must be positive", tstr);
else {
double f, d;
d = modf(RFLOAT(time)->float_value, &f);
d = modf(RFLOAT_VALUE(time), &f);
if (d < 0) {
d += 1;
f -= 1;
@ -132,7 +132,7 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) {
t.tv_sec = (time_t)f;
if (f != t.tv_sec) {
rb_raise(rb_eRangeError, "%f out of Time range",
RFLOAT(time)->float_value);
RFLOAT_VALUE(time));
}
t.tv_nsec = (time_t)(d * 1e9 + 0.5);
}

Loading…
Cancel
Save