From 59e4e93ef7b6b7f1536e3c56374cc6b8d74b5d28 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 25 Feb 2010 22:49:20 +0000 Subject: * ext/dl: revert dl with libffi because it can't run on mswin now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dl/dl.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'ext/dl/dl.c') diff --git a/ext/dl/dl.c b/ext/dl/dl.c index 8f8212015b..9635794883 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(); } -- cgit v1.2.3