aboutsummaryrefslogtreecommitdiffstats
path: root/ext/dl/cfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/cfunc.c')
-rw-r--r--ext/dl/cfunc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c
index f5ad3ddd63..33ac78490f 100644
--- a/ext/dl/cfunc.c
+++ b/ext/dl/cfunc.c
@@ -566,13 +566,15 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
}
#endif
else{
- rb_raise(rb_eDLError,
-#ifndef LONG_LONG_VALUE
- "unsupported call type: %lx",
-#else
- "unsupported call type: %llx",
-#endif
- cfunc->calltype);
+ const char *name = rb_id2name(cfunc->calltype);
+ if( name ){
+ rb_raise(rb_eDLError, "unsupported call type: %s",
+ name);
+ }
+ else{
+ rb_raise(rb_eDLError, "unsupported call type: %"PRIxVALUE,
+ cfunc->calltype);
+ }
}
rb_dl_set_last_error(self, INT2NUM(errno));