~ruther/guix-local

4a30e84e6182686fde93504e07616fe8e70d94d5 — Ludovic Courtès 10 years ago b89e740
syscalls: 'define-c-struct' distinguishes pointers from integers.

* guix/build/syscalls.scm (read-type): Add special-case for when TYPE is '*.
1 files changed, 5 insertions(+), 1 deletions(-)

M guix/build/syscalls.scm
M guix/build/syscalls.scm => guix/build/syscalls.scm +5 -1
@@ 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)))