Support calling foreign functions of 10 arguments or more.
authorMark H Weaver <mhw@netris.org>
Tue, 26 Feb 2013 22:25:51 +0000 (17:25 -0500)
committerMark H Weaver <mhw@netris.org>
Thu, 28 Feb 2013 09:11:35 +0000 (04:11 -0500)
commit5ccc3764b3e17a328dad515d9a74123653f1fef9
tree0cf8789d27551bf17905f168db02d051c53283c2
parentaacc689677316ebb1ea45bb8fb22f921ebaf97d5
Support calling foreign functions of 10 arguments or more.

* libguile/foreign.c (OBJCODE_HEADER, META_HEADER, META): Change these
  into higher-order macros.
  (GEN_CODE): New higher-order macro based on 'CODE'.
  (M_STATIC, M_DYNAMIC): New macros.
  (CODE): Reimplement using 'GEN_CODE' and 'M_STATIC'.
  (make_objcode_trampoline): New static function.
  (large_objcode_trampolines, large_objcode_trampolines_mutex): New
  static variables.
  (get_objcode_trampoline): New static function.
  (cif_to_procedure): Use 'get_objcode_trampoline'.

* test-suite/standalone/test-ffi-lib.c (test_ffi_sum_many):
  New function.

* test-suite/standalone/test-ffi: Add test.
libguile/foreign.c
test-suite/standalone/test-ffi
test-suite/standalone/test-ffi-lib.c