diff --git a/ext/geohash_native.c b/ext/geohash_native.c index 0284c82..3aca1ce 100644 --- a/ext/geohash_native.c +++ b/ext/geohash_native.c @@ -28,6 +28,13 @@ #include "ruby.h" #include +#ifndef RUBY_19 +#ifndef RFLOAT_VALUE +#define RFLOAT_VALUE(v) (RFLOAT(v)->value) +#endif +#endif + + static VALUE rb_cGeoHash; #define BASE32 "0123456789bcdefghjkmnpqrstuvwxyz" @@ -120,7 +127,7 @@ static VALUE encode(VALUE self, VALUE lat, VALUE lon, VALUE precision) if (digits <3 || digits > 12) digits = 12; - encode_geohash(RFLOAT(lat)->value, RFLOAT(lon)->value, digits, str); + encode_geohash(RFLOAT_VALUE(lat), RFLOAT_VALUE(lon), digits, str); geohash = rb_str_new2(str); return geohash; diff --git a/geohash.gemspec b/geohash.gemspec index 61a8850..827fc25 100644 --- a/geohash.gemspec +++ b/geohash.gemspec @@ -2,7 +2,7 @@ jruby = !!() Gem::Specification.new do |s| s.name = "geohash" - s.version = '1.1.1' + s.version = '1.1.2' s.date = "2010-09-14" s.summary = "GeoHash Library for Ruby, per http://geohash.org implementation." s.email = "dave@popvox.com"