summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 06:44:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 06:44:26 +0000
commit475e705b2f0d757d7b6eb9698735931a68ae8f6b (patch)
tree9a0f5f754a18c01586a89fe8934fef8a611617a0 /ext
parentd64d462f7ad6fd1f8f182b8a9ceb2a63e26adf37 (diff)
* ext/dl/handle.c (dlhandle_sym): fixed an invalid local variable
declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/dl/handle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index 522d1a1dc6..dddd8d54e9 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -296,16 +296,16 @@ rb_dlhandle_s_sym(VALUE self, VALUE sym)
static VALUE
dlhandle_sym(void *handle, const char *name)
{
- rb_secure(2);
-
#if defined(HAVE_DLERROR)
const char *err;
# define CHECK_DLERROR if( err = dlerror() ){ func = 0; }
#else
# define CHECK_DLERROR
#endif
- void (*func)() = dlsym(handle, name);
+ void (*func)();
+ rb_secure(2);
+ func = dlsym(handle, name);
CHECK_DLERROR;
#if defined(FUNC_STDCALL)
if( !func ){
@@ -374,4 +374,4 @@ Init_dlhandle(void)
rb_define_method(rb_cDLHandle, "close_enabled?", rb_dlhandle_close_enabled_p, 0);
}
-/* mode: c; tab-with=8; sw=8; ts=8; noexpandtab: */
+/* mode: c; tab-with=8; sw=4; ts=8; noexpandtab: */