1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

6 commits

Author SHA1 Message Date
Ludovic Courtès
134fe52a85 Placate GCC in `test-ffi-lib.c'.
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.
2011-06-20 00:45:18 +02:00
Ludovic Courtès
eb0ffdd819 Fix `#ifdef HAVE_CONFIG_H' stanza in some stand-alone tests.
* test-suite/standalone/test-asmobs-lib.c,
  test-suite/standalone/test-extensions-lib.c,
  test-suite/standalone/test-ffi-lib.c,
  test-suite/standalone/test-list.c,
  test-suite/standalone/test-num2integral.c,
  test-suite/standalone/test-with-guile-module.c: Change `#ifndef
  HAVE_CONFIG_H' to `#ifdef HAVE_CONFIG_H' (!).
2011-04-25 23:59:35 +02:00
Ludovic Courtès
3318635666 Add `procedure->pointer' to the FFI.
* 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'.
2010-09-03 15:26:37 +02:00
Andy Wingo
17d819d4c4 add a test for ffi and pointers
* test-suite/standalone/test-ffi:
* test-suite/standalone/test-ffi-lib.c: Add a pointer test.
2010-01-27 22:25:29 +01:00
Andy Wingo
c612ed59ab add a test for foreign functions taking struct args
* test-suite/standalone/test-ffi (f-sum-struct):
* test-suite/standalone/test-ffi-lib.c (test_ffi_sum_struct): Add a
  struct test. Wheee....
2010-01-26 22:56:42 +01:00
Andy Wingo
37371ea1ba add ffi tests
* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-ffi:
* test-suite/standalone/test-ffi-lib.c: Add some tests for the ffi.
2010-01-26 22:56:42 +01:00