rdp / google_hash

wrapper for google's hash functions, for ruby
BSD 3-Clause "New" or "Revised" License
92 stars 16 forks source link

install error with Ruby 2.2.0 #32

Closed slecorne closed 9 years ago

slecorne commented 9 years ago

RBIGNUM does not seem to be defined anymore sparse_ruby_to_int.cpp:84: error: ‘RBIGNUM’ was not declared in this scope

YvanDaSilva commented 9 years ago

RBIGNUM AND RBIGNUM_DIGITS were removed from the ruby.h of Ruby 2.2.0.

If you need this right now you can edit your ruby.h and change it to look like this:

struct RBignum {
    struct RBasic basic;
    char sign;
    long len;
    void *digits;
};
#define RBIGNUM_SIGN(b) (FIX2LONG(rb_big_cmp((b), INT2FIX(0))) >= 0)
#define RBIGNUM_POSITIVE_P(b) (FIX2LONG(rb_big_cmp((b), INT2FIX(0))) >= 0)
#define RBIGNUM_NEGATIVE_P(b) (FIX2LONG(rb_big_cmp((b), INT2FIX(0))) < 0)
#define RBIGNUM_DIGITS(b)     (RBIGNUM(b)->digits)

#define R_CAST(st)   (struct st*)
#define RBASIC(obj)  (R_CAST(RBasic)(obj))
#define ROBJECT(obj) (R_CAST(RObject)(obj))
#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
#define RCLASS(obj)  (R_CAST(RClass)(obj))
#define RMODULE(obj) RCLASS(obj)
#define RSTRING(obj) (R_CAST(RString)(obj))
#define RREGEXP(obj) (R_CAST(RRegexp)(obj))
#define RARRAY(obj)  (R_CAST(RArray)(obj))
#define RDATA(obj)   (R_CAST(RData)(obj))
#define RTYPEDDATA(obj)   (R_CAST(RTypedData)(obj))
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
#define RFILE(obj)   (R_CAST(RFile)(obj))

Look for RBIGNUM in the ruby.h.

NOTE: I didn't test this more than the compilation success yet!

YvanDaSilva commented 9 years ago

@rdp I do not know how do you want to fix this, if you want to edit your sparse_ruby_to_int.cpp to include those definition and structure or if you want to change the usage of that structure in your implementation.

Best, Yvan.

rdp commented 9 years ago

could you try with git master please?

On Mon, Jan 5, 2015 at 7:53 AM, Yvan Da Silva notifications@github.com wrote:

@rdp https://github.com/rdp I do not know how do you want to fix this, if you want to edit your sparse_ruby_to_int.cpp to include those definition and structure or if you want to change the usage of that structure in your implementation.

Best, Yvan.

— Reply to this email directly or view it on GitHub https://github.com/rdp/google_hash/issues/32#issuecomment-68717675.

slecorne commented 9 years ago

build fine from master. Thanks! You should also update your .gemspec file to remove "clean.sh" from the list of files to have it build with bundler since it has been removed

rdp commented 9 years ago

ok hopefully fixed in 0.8.5 (thanks for the note). -roger-