summaryrefslogtreecommitdiff
path: root/ext/dl/dl_conversions.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/dl_conversions.c')
-rw-r--r--ext/dl/dl_conversions.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/ext/dl/dl_conversions.c b/ext/dl/dl_conversions.c
deleted file mode 100644
index 13310065070..00000000000
--- a/ext/dl/dl_conversions.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <dl_conversions.h>
-
-ffi_type *
-rb_dl_type_to_ffi_type(int dl_type)
-{
- int signed_p = 1;
-
- if (dl_type < 0) {
- dl_type = -1 * dl_type;
- signed_p = 0;
- }
-
-#define rb_ffi_type_of(t) (signed_p ? &ffi_type_s##t : &ffi_type_u##t)
-
- switch (dl_type) {
- case DLTYPE_VOID:
- return &ffi_type_void;
- case DLTYPE_VOIDP:
- return &ffi_type_pointer;
- case DLTYPE_CHAR:
- return rb_ffi_type_of(char);
- case DLTYPE_SHORT:
- return rb_ffi_type_of(short);
- case DLTYPE_INT:
- return rb_ffi_type_of(int);
- case DLTYPE_LONG:
- return rb_ffi_type_of(long);
-#if HAVE_LONG_LONG
- case DLTYPE_LONG_LONG:
- return rb_ffi_type_of(int64);
-#endif
- case DLTYPE_FLOAT:
- return &ffi_type_float;
- case DLTYPE_DOUBLE:
- return &ffi_type_double;
- default:
- rb_raise(rb_eRuntimeError, "unknown type %d", dl_type);
- }
- return &ffi_type_pointer;
-}