1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rb_enc_alias

`rb_encdb`-prefixed functions are only for internal use.
use rb_enc_alias instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-06-28 23:46:59 +00:00
parent 63e72a5850
commit c69b33c468
4 changed files with 10 additions and 10 deletions

View file

@ -93,12 +93,11 @@ 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);
#ifdef HAVE_RB_ENC_ALIAS
extern int rb_enc_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)));
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 +325,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