Archived
1
0
Fork 0

Check for required Tox ABI version in runtime

This commit is contained in:
Braiden Vasco 2015-09-13 10:07:26 +00:00
parent ee7adc3a5c
commit 9cb26831bc
2 changed files with 4 additions and 0 deletions

View file

@ -13,5 +13,6 @@ have_library LIBTOXCORE, 'tox_get_savedata' and
have_library LIBTOXCORE, 'tox_self_get_address' and have_library LIBTOXCORE, 'tox_self_get_address' and
have_library LIBTOXCORE, 'tox_bootstrap' and have_library LIBTOXCORE, 'tox_bootstrap' and
have_library LIBTOXCORE, 'tox_kill' and have_library LIBTOXCORE, 'tox_kill' and
have_library LIBTOXCORE, 'tox_version_is_compatible' and
create_makefile "#{NAME}/#{NAME}" or exit(1) create_makefile "#{NAME}/#{NAME}" or exit(1)

View file

@ -45,6 +45,9 @@ static VALUE cTox_cOptions_data_EQUALS(VALUE self, VALUE data);
void Init_tox() void Init_tox()
{ {
if (!TOX_VERSION_IS_ABI_COMPATIBLE())
rb_raise(rb_eLoadError, "incompatible Tox ABI version");
cTox = rb_define_class("Tox", rb_cObject); cTox = rb_define_class("Tox", rb_cObject);
rb_define_alloc_func(cTox, cTox_alloc); rb_define_alloc_func(cTox, cTox_alloc);
rb_define_method(cTox, "initialize_with", cTox_initialize_with, 1); rb_define_method(cTox, "initialize_with", cTox_initialize_with, 1);