Commit
…n loading a native extension PullRequest: truffleruby/2735
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3 | ||
4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,12 @@ POLYGLOT_DECLARE_TYPE(VALUE) | |
extern void* rb_tr_cext; | ||
#define RUBY_CEXT rb_tr_cext | ||
|
||
void* rb_tr_abi_version(void) __attribute__((weak)); | ||
void* rb_tr_abi_version(void) { | ||
char* abi_version = STRINGIZE(TRUFFLERUBY_ABI_VERSION); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
eregon
Author
Member
|
||
return polyglot_from_string(abi_version, "US-ASCII"); | ||
} | ||
|
||
// Wrapping and unwrapping of values. | ||
|
||
extern void* (*rb_tr_unwrap)(VALUE obj); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <stdio.h> | ||
#include <ruby.h> | ||
|
||
void Init_minimum() { | ||
printf("Hello!\n"); | ||
|
Unfortunately
STRINGIZE(TRUFFLERUBY_ABI_VERSION)
is just the string literal#TRUFFLERUBY_ABI_VERSION
, so this causes errors likeLoadError: The native extension […] has a different ABI version: "TRUFFLERUBY_ABI_VERSION" than the running TruffleRuby: "2.7.3.4"
.