guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-144-g443f2


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-144-g443f25d
Date: Tue, 29 Mar 2011 21:35:34 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=443f25dcff49f0a920d4149e29bcb3ae9f64ee02

The branch, stable-2.0 has been updated
       via  443f25dcff49f0a920d4149e29bcb3ae9f64ee02 (commit)
      from  572eef50c2d902d34427945dd504ba03af666e48 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 443f25dcff49f0a920d4149e29bcb3ae9f64ee02
Author: Ludovic Courtès <address@hidden>
Date:   Tue Mar 29 23:35:24 2011 +0200

    Fix `procedure->pointer' for functions returning `void'.
    
    * libguile/foreign.c (unpack): Handle `FFI_TYPE_VOID'.
    
    * test-suite/tests/foreign.test ("procedure->pointer")["procedures
      returning void"]: New test.  Reported by
      Tristan Colgate <address@hidden>.

-----------------------------------------------------------------------

Summary of changes:
 libguile/foreign.c            |    3 +++
 test-suite/tests/foreign.test |   10 ++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libguile/foreign.c b/libguile/foreign.c
index 494ab5b..dbfba87 100644
--- a/libguile/foreign.c
+++ b/libguile/foreign.c
@@ -905,6 +905,9 @@ unpack (const ffi_type *type, void *loc, SCM x)
       SCM_VALIDATE_POINTER (1, x);
       *(void **) loc = SCM_POINTER_VALUE (x);
       break;
+    case FFI_TYPE_VOID:
+      /* Do nothing.  */
+      break;
     default:
       abort ();
     }
diff --git a/test-suite/tests/foreign.test b/test-suite/tests/foreign.test
index 3ff232e..93e5fe1 100644
--- a/test-suite/tests/foreign.test
+++ b/test-suite/tests/foreign.test
@@ -225,6 +225,16 @@
                (arg3  (map (cut / <> 4.0) (iota 123 100 4))))
           (equal? (map proc arg1 arg2 arg3)
                   (map proc* arg1 arg2 arg3)))
+        (throw 'unresolved)))
+
+  (pass-if "procedures returning void"
+    (if (defined? 'procedure->pointer)
+        (let* ((called? #f)
+               (proc    (lambda () (set! called? #t)))
+               (pointer (procedure->pointer void proc '()))
+               (proc*   (pointer->procedure void pointer '())))
+          (proc*)
+          called?)
         (throw 'unresolved))))
 
 


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]