diff options
Diffstat (limited to 'spec/ruby/optional/capi/ext')
-rw-r--r-- | spec/ruby/optional/capi/ext/rubyspec.h | 1 | ||||
-rw-r--r-- | spec/ruby/optional/capi/ext/string_spec.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/ext/rubyspec.h b/spec/ruby/optional/capi/ext/rubyspec.h index e5a90bfc88..63691d62fd 100644 --- a/spec/ruby/optional/capi/ext/rubyspec.h +++ b/spec/ruby/optional/capi/ext/rubyspec.h @@ -572,6 +572,7 @@ #define HAVE_RB_STRING 1 #define HAVE_SAFE_STRING_VALUE 1 #define HAVE_RB_STRING_VALUE_CSTR 1 +#define HAVE_RB_STR_MODIFY 1 /* Struct */ #define HAVE_RB_STRUCT_AREF 1 diff --git a/spec/ruby/optional/capi/ext/string_spec.c b/spec/ruby/optional/capi/ext/string_spec.c index a6ce02b25c..6650034ef1 100644 --- a/spec/ruby/optional/capi/ext/string_spec.c +++ b/spec/ruby/optional/capi/ext/string_spec.c @@ -504,6 +504,13 @@ static VALUE string_spec_rb_string_value_cstr(VALUE self, VALUE str) { } #endif +#ifdef HAVE_RB_STR_MODIFY +static VALUE string_spec_rb_str_modify(VALUE self, VALUE str) { + rb_str_modify(str); + return str; +} +#endif + void Init_string_spec(void) { VALUE cls; cls = rb_define_class("CApiStringSpecs", rb_cObject); @@ -744,6 +751,10 @@ void Init_string_spec(void) { #ifdef HAVE_RB_STRING_VALUE_CSTR rb_define_method(cls, "rb_string_value_cstr", string_spec_rb_string_value_cstr, 1); #endif + +#ifdef HAVE_RB_STR_MODIFY + rb_define_method(cls, "rb_str_modify", string_spec_rb_str_modify, 1); +#endif } #ifdef __cplusplus } |