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

* guix/build/syscalls.scm (read-type): Add special-case for when TYPE is '*.
This commit is contained in:
Ludovic Courtès 2015-07-25 11:50:23 +02:00
parent b89e74054e
commit 4a30e84e61
1 changed files with 5 additions and 1 deletions

View File

@ -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)))