* 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.
This fixes warnings saying "this decimal constant is unsigned only in
ISO C90".
* test-suite/standalone/test-ffi-lib.c (test_ffi_u32_, test_ffi_u32_u8,
test_ffi_u32_s64, test_ffi_s64_s64, test_ffi_u64_u8,
test_ffi_u64_s64): Mark constants as unsigned.
* libguile/foreign.c (make_cif): New procedure, with code formerly in
`scm_make_foreign_function'.
(scm_make_foreign_function): Use it.
(invoke_closure, scm_procedure_to_pointer)[FFI_CLOSURES]: New
functions.
* libguile/foreign.h (scm_procedure_to_pointer): New declaration.
* module/system/foreign.scm: Export `procedure->pointer' when available.
* test-suite/standalone/test-ffi (f-callback-1, f-callback-2): New
procedures and related tests.
* test-suite/standalone/test-ffi-lib.c (test_ffi_callback_1,
test_ffi_callback_2): New functions.
* test-suite/tests/foreign.test ("procedure->pointer"): New test prefix.
* doc/ref/api-foreign.texi (Dynamic FFI): Document `procedure->pointer'.