guix-commits
[Top][All Lists]
Advanced

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

03/06: syscalls: 'define-c-struct' distinguishes pointers from integers.


From: Ludovic Courtès
Subject: 03/06: syscalls: 'define-c-struct' distinguishes pointers from integers.
Date: Sat, 25 Jul 2015 12:45:09 +0000

civodul pushed a commit to branch master
in repository guix.

commit 4a30e84e6182686fde93504e07616fe8e70d94d5
Author: Ludovic Courtès <address@hidden>
Date:   Sat Jul 25 11:50:23 2015 +0200

    syscalls: 'define-c-struct' distinguishes pointers from integers.
    
    * guix/build/syscalls.scm (read-type): Add special-case for when TYPE is '*.
---
 guix/build/syscalls.scm |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index ae5b2ed..73c5437 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -388,7 +388,11 @@ system to PUT-OLD."
                     (types ...) (fields ...))))))
 
 (define-syntax read-type
-  (syntax-rules (~)
+  (syntax-rules (~ quote *)
+    ((_ bv offset '*)
+     (make-pointer (bytevector-uint-ref bv offset
+                                        (native-endianness)
+                                        (sizeof* '*))))
     ((_ bv offset (type ~ order))
      (bytevector-uint-ref bv offset
                           (endianness order) (sizeof* type)))



reply via email to

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