Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ruby 3.3 compatibility and bump version to 1.8.4 #13

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
3.3.0
8 changes: 7 additions & 1 deletion ext/rlibmemcached.i
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <libmemcached/visibility.h>
#include <libmemcached/memcached.h>
#include <libmemcached/memcached_exist.h>
#include <ruby/version.h>
%}

%warnfilter(SWIGWARN_RUBY_WRONG_NAME) memcached_st;
Expand Down Expand Up @@ -161,7 +162,12 @@ VALUE rb_str_new_by_ref(char *ptr, long len)
#ifdef RSTRING_NOEMBED
/* Ruby 1.9 */
str->as.heap.ptr = ptr;
str->as.heap.len = len;
#if RUBY_API_VERSION_MAJOR < 3 || (RUBY_API_VERSION_MAJOR == 3 && RUBY_API_VERSION_MINOR < 3)
str->as.heap.len = len;
#else
// Ruby 3.3.0 moved the len field out of heap into toplevel RString
str->len = len;
#endif
str->as.heap.aux.capa = len + 1;
// Set STR_NOEMBED
FL_SET(str, FL_USER1);
Expand Down
Loading
Loading