From 4a30e84e6182686fde93504e07616fe8e70d94d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 25 Jul 2015 11:50:23 +0200 Subject: 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 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix') 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))) -- cgit v1.2.3