diff options
Diffstat (limited to 'spec/ruby/optional/capi/ext/encoding_spec.c')
-rw-r--r-- | spec/ruby/optional/capi/ext/encoding_spec.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/spec/ruby/optional/capi/ext/encoding_spec.c b/spec/ruby/optional/capi/ext/encoding_spec.c index 6f4057865b..9ab893b86a 100644 --- a/spec/ruby/optional/capi/ext/encoding_spec.c +++ b/spec/ruby/optional/capi/ext/encoding_spec.c @@ -93,12 +93,9 @@ static VALUE encoding_spec_rb_default_external_encoding(VALUE self) { } #endif -#ifdef HAVE_RB_ENCDB_ALIAS -/* Not exposed by MRI C-API encoding.h but used in the pg gem. */ -extern int rb_encdb_alias(const char* alias, const char* orig); - -static VALUE encoding_spec_rb_encdb_alias(VALUE self, VALUE alias, VALUE orig) { - return INT2NUM(rb_encdb_alias(RSTRING_PTR(alias), RSTRING_PTR(orig))); +#ifdef HAVE_RB_ENC_ALIAS +static VALUE encoding_spec_rb_enc_alias(VALUE self, VALUE alias, VALUE orig) { + return INT2NUM(rb_enc_alias(RSTRING_PTR(alias), RSTRING_PTR(orig))); } #endif @@ -326,8 +323,8 @@ void Init_encoding_spec(void) { encoding_spec_rb_default_external_encoding, 0); #endif -#ifdef HAVE_RB_ENCDB_ALIAS - rb_define_method(cls, "rb_encdb_alias", encoding_spec_rb_encdb_alias, 2); +#ifdef HAVE_RB_ENC_ALIAS + rb_define_method(cls, "rb_enc_alias", encoding_spec_rb_enc_alias, 2); #endif #ifdef HAVE_RB_ENC_ASSOCIATE |