Improve error message in load_external_gc_func

This commit is contained in:
Peter Zhu 2024-10-07 09:47:21 -04:00
parent 613694734e
commit 7cdbf93a89
Notes: git 2024-10-08 13:49:07 +00:00

5
gc.c
View File

@ -690,9 +690,10 @@ ruby_external_gc_init(void)
# define load_external_gc_func(name) do { \
if (handle) { \
gc_functions.name = dlsym(handle, "rb_gc_impl_" #name); \
const char *func_name = "rb_gc_impl_" #name; \
gc_functions.name = dlsym(handle, func_name); \
if (!gc_functions.name) { \
fprintf(stderr, "ruby_external_gc_init: " #name " func not exported by library %s\n", gc_so_path); \
fprintf(stderr, "ruby_external_gc_init: %s function not exported by library %s\n", func_name, gc_so_path); \
exit(1); \
} \
} \