Skip to content

Commit

Permalink
typedef ABI version types
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Nov 21, 2023
1 parent f5c3cda commit 029871c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dln.c
Expand Up @@ -463,8 +463,10 @@ dln_load(const char *file)
void *handle = dln_open(file);

#ifdef RUBY_DLN_CHECK_ABI
unsigned long long (*abi_version_fct)(void) = (unsigned long long(*)(void))dln_sym(handle, "ruby_abi_version");
unsigned long long binary_abi_version = (*abi_version_fct)();
typedef unsigned long long abi_version_number;
typedef abi_version_number abi_version_func(void);
abi_version_func *abi_version_fct = (abi_version_func *)dln_sym(handle, "ruby_abi_version");
abi_version_number binary_abi_version = (*abi_version_fct)();
if (binary_abi_version != ruby_abi_version() && abi_check_enabled_p()) {
dln_loaderror("incompatible ABI version of binary - %s", file);
}
Expand Down

0 comments on commit 029871c

Please sign in to comment.