erickguan / cppjieba_rb

MIT License
17 stars 3 forks source link

fix: update rb_cData to rb_cObject to support Ruby 3.2+ #4

Closed flavorjones closed 2 years ago

flavorjones commented 2 years ago

rb_cData was deprecated in Ruby 3.1 and removed in Ruby 3.2.

Fixes #3

Without this change, compiling results in this error:

compiling ../../../../ext/cppjieba_rb/internal.cc
../../../../ext/cppjieba_rb/internal.cc: In function ‘void Init_internal()’:
../../../../ext/cppjieba_rb/internal.cc:166:81: error: ‘rb_cData’ was not declared in this scope; did you mean ‘rb_eFatal’?
  166 |     rb_cCppjiebaRb_Internal = rb_define_class_under(rb_mCppjiebaRb, "Internal", rb_cData);
      |                                                                                 ^~~~~~~~
      |                                                                                 rb_eFatal
make: *** [Makefile:214: internal.o] Error 1
erickguan commented 2 years ago

Thanks for the details!