Fix zlib ffi driver on 32-bit big endian platforms. Fixes gem

installation on macppc.  Thanks to ajacoutot@ for access to a macppc
machine.

OK ajacoutot@, jasper@
This commit is contained in:
jeremy 2011-01-21 16:36:53 +00:00
parent 9430082d68
commit be40d18596
2 changed files with 25 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 2011/01/13 00:21:03 jeremy Exp $
# $OpenBSD: Makefile,v 1.8 2011/01/21 16:36:53 jeremy Exp $
SHARED_ONLY= Yes
@ -7,7 +7,7 @@ COMMENT = Ruby virtual machine and core library
V= 1.2.0
DISTNAME = rubinius-${V}-20101221
PKGNAME = rubinius-$V
REVISION = 2
REVISION = 3
CATEGORIES = lang lang/ruby

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-lib_zlib_rb_ffi,v 1.1 2011/01/21 16:36:53 jeremy Exp $
OpenBSD uses off_t instead of unsigned long for the total_in and
total_out struct members, so it works on files >4GB. Rubinius has
harcoded ulong instead of checking, as ulong is what most other
OSes use.
--- lib/zlib.rb.ffi.orig Thu Jan 20 11:45:11 2011
+++ lib/zlib.rb.ffi Thu Jan 20 11:45:15 2011
@@ -245,11 +245,11 @@ module Zlib
s.name "struct z_stream_s"
s.field :next_in, :pointer
s.field :avail_in, :uint
- s.field :total_in, :ulong
+ s.field :total_in, :off_t
s.field :next_out, :pointer
s.field :avail_out, :uint
- s.field :total_out, :ulong
+ s.field :total_out, :off_t
s.field :msg, :string
s.field :state, :pointer