aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-25 11:50:23 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-25 14:43:44 +0200
commit4a30e84e6182686fde93504e07616fe8e70d94d5 (patch)
treef2f994ab7cc80d70e931295053f808f4fee2cbf7
parentb89e74054ee54b3afc8aed99fe9be89e8e05890b (diff)
downloadpatches-4a30e84e6182686fde93504e07616fe8e70d94d5.tar
patches-4a30e84e6182686fde93504e07616fe8e70d94d5.tar.gz
syscalls: 'define-c-struct' distinguishes pointers from integers.
* guix/build/syscalls.scm (read-type): Add special-case for when TYPE is '*.
-rw-r--r--guix/build/syscalls.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index ae5b2ed112..73c54372e1 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)))