Fix small integer return value packing on big endian machines.
authorLudovic Courtès <ludo@gnu.org>
Sun, 8 May 2011 15:21:59 +0000 (17:21 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sun, 8 May 2011 15:24:24 +0000 (17:24 +0200)
commit012062a0d61cbd297dd58c8168433518c8b450cc
treefca9076c455e3d200b0e17f4bc365b79f15c832e
parentd7fcaec39247b014f3d6aa2ca96a5ff903bc6706
Fix small integer return value packing on big endian machines.

* libguile/foreign.c (pack): Add `return_value_p' parameter.  Update
  callers.
  When RETURN_VALUE_P is true, assume LOC points to an `ffi_arg', and
  cast its results to the relevant type.  This fixes packing of integer
  return values smaller than `int' on SPARC64 and PowerPC64.  Reported
  by Nelson H. F. Beebe <beebe@math.utah.edu>.
libguile/foreign.c