This issue was solved with changeset r34800.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_t
and intptr_t. [ruby-core:42460][Feature #5992]