Re-export castForeignPtr