Add `scm_t_off' type so that `scm_t_port' has a fixed layout.
authorLudovic Courtès <ludo@gnu.org>
Thu, 25 Jun 2009 21:32:44 +0000 (23:32 +0200)
committerLudovic Courtès <ludo@gnu.org>
Thu, 25 Jun 2009 21:32:44 +0000 (23:32 +0200)
commitf1ce9199335bebab1a62286ac965f33dc91ca97f
tree4f34d046432a472d0ce65c04562ed037fd6e382c
parent376b6bd7a2d2484f5579645becc26c40a97c31a6
Add `scm_t_off' type so that `scm_t_port' has a fixed layout.

* libguile/gen-scmconfig.c (main): Produce a definition for
  `scm_t_off'.

* libguile/ports.h (scm_t_port)[read_buf_size, saved_read_buf_size,
  write_buf_size, seek, truncate]: Use `scm_t_off' instead of `off_t' so
  that the layout and size of the structure does not depend on the
  application's `_FILE_OFFSET_BITS' value.  Reported by Bill
  Schottstaedt, see
  http://lists.gnu.org/archive/html/bug-guile/2009-06/msg00018.html.
  (scm_set_port_seek, scm_set_port_truncate): Update.

* libguile/ports.c (scm_set_port_seek, scm_set_port_truncate): Use
  `scm_t_off' and `off_t_or_off64_t'.

* libguile/fports.c (fport_seek, fport_truncate): Use `scm_t_off'
  instead of `off_t'.

* libguile/r6rs-ports.c (bip_seek, cbp_seek, bop_seek): Use `scm_t_off'
  instead of `off_t'.

* libguile/rw.c (scm_write_string_partial): Likewise.

* libguile/strports.c (st_resize_port, st_seek, st_truncate): Likewise.

* doc/ref/api-io.texi (Port Implementation): Update prototype of
  `scm_set_port_seek ()' and `scm_set_port_truncate ()'.

* NEWS: Update.
NEWS
doc/ref/api-io.texi
libguile/fports.c
libguile/gen-scmconfig.c
libguile/ports.c
libguile/ports.h
libguile/r6rs-ports.c
libguile/rw.c
libguile/strports.c