Skip to content

Commit

Permalink
Remove no longer used RUBY_ABI_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 1, 2023
1 parent 492c82c commit 90c582a
Show file tree
Hide file tree
Showing 106 changed files with 6 additions and 539 deletions.
85 changes: 0 additions & 85 deletions common.mk

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ AC_SUBST(GIT)
AC_SUBST(HAVE_GIT)

eval `sed -n -e ['s/^@%:@define RUBY_[A-Z_]*VERSION_\([A-Z][A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)$/\1=\2/p'] \
-e ['s/^@%:@define \(RUBY_ABI_VERSION\) \([0-9][0-9]*\).*/\1=\2/p'] \
-e ['s/^@%:@define \(RUBY_PATCHLEVEL\) \(.*\)/\1=\2/p'] \
$srcdir/include/ruby/internal/abi.h \
$srcdir/include/ruby/version.h $srcdir/version.h`
for v in MAJOR MINOR TEENY; do
AS_IF([eval "test \"\$$v\" = ''"], [
Expand All @@ -121,9 +119,6 @@ AC_SUBST(MINOR)
AC_SUBST(TEENY)
AC_SUBST(RUBY_API_VERSION, '$(MAJOR).$(MINOR)')
AC_SUBST(RUBY_PROGRAM_VERSION, '$(MAJOR).$(MINOR).$(TEENY)')
AS_CASE([$RUBY_PATCHLEVEL], [-*], [
AC_DEFINE_UNQUOTED(RUBY_ABI_VERSION, [${RUBY_ABI_VERSION}])
], [RUBY_ABI_VERSION=])

AS_IF([test "$program_prefix" = NONE], [
program_prefix=
Expand Down
3 changes: 1 addition & 2 deletions defs/gmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,9 @@ ruby.pc: $(filter-out ruby.pc,$(ruby_pc))
matz: up
$(eval MINOR := $(shell expr $(MINOR) + 1))
$(eval message := Development of $(MAJOR).$(MINOR).0 started.)
$(eval files := include/ruby/version.h include/ruby/internal/abi.h)
$(eval files := include/ruby/version.h)
sed -i~ \
-e "s/^\(#define RUBY_API_VERSION_MINOR\) .*/\1 $(MINOR)/" \
-e "s/^\(#define RUBY_ABI_VERSION\) .*/\1 0/" \
$(files:%=$(srcdir)/%)
$(GIT) -C $(srcdir) commit -m "$(message)" $(files)

Expand Down
19 changes: 0 additions & 19 deletions dln.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,31 +447,12 @@ dln_sym(void *handle, const char *symbol)
}
#endif

#if defined(RUBY_DLN_CHECK_ABI) && defined(USE_DLN_DLOPEN)
static bool
abi_check_enabled_p(void)
{
const char *val = getenv("RUBY_ABI_CHECK");
return val == NULL || !(val[0] == '0' && val[1] == '\0');
}
#endif

void *
dln_load(const char *file)
{
#if defined(_WIN32) || defined(USE_DLN_DLOPEN)
void *handle = dln_open(file);

#ifdef RUBY_DLN_CHECK_ABI
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, EXTERNAL_PREFIX "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);
}
#endif

char *init_fct_name;
init_funcname(&init_fct_name, file);
void (*init_fct)(void) = (void(*)(void))dln_sym(handle, init_fct_name);
Expand Down
Loading

0 comments on commit 90c582a

Please sign in to comment.