summaryrefslogtreecommitdiff
path: root/ext/dl/dl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/dl.c')
-rw-r--r--ext/dl/dl.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 8f8212015b8..96357948836 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -77,6 +77,19 @@ rb_dl_value2ptr(VALUE self, VALUE val)
return PTR2NUM((void*)val);
}
+static void
+rb_dl_init_callbacks(VALUE dl)
+{
+ static const char cb[] = "dl/callback.so";
+
+ rb_autoload(dl, rb_intern_const("CdeclCallbackAddrs"), cb);
+ rb_autoload(dl, rb_intern_const("CdeclCallbackProcs"), cb);
+#ifdef FUNC_STDCALL
+ rb_autoload(dl, rb_intern_const("StdcallCallbackAddrs"), cb);
+ rb_autoload(dl, rb_intern_const("StdcallCallbackProcs"), cb);
+#endif
+}
+
void
Init_dl(void)
{
@@ -94,6 +107,8 @@ Init_dl(void)
rb_define_const(rb_mDL, "MAX_CALLBACK", INT2NUM(MAX_CALLBACK));
rb_define_const(rb_mDL, "DLSTACK_SIZE", INT2NUM(DLSTACK_SIZE));
+ rb_dl_init_callbacks(rb_mDL);
+
rb_define_const(rb_mDL, "RTLD_GLOBAL", INT2NUM(RTLD_GLOBAL));
rb_define_const(rb_mDL, "RTLD_LAZY", INT2NUM(RTLD_LAZY));
rb_define_const(rb_mDL, "RTLD_NOW", INT2NUM(RTLD_NOW));
@@ -147,6 +162,4 @@ Init_dl(void)
Init_dlhandle();
Init_dlcfunc();
Init_dlptr();
- Init_dlfunction();
- Init_dlclosure();
}