[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)))
- branch master updated (bd4af2f -> e7f5691), Ludovic Courtès, 2015/07/25
- 01/06: doc: Make "Application Setup" more prominent., Ludovic Courtès, 2015/07/25
- 03/06: syscalls: 'define-c-struct' distinguishes pointers from integers.,
Ludovic Courtès <=
- 02/06: syscalls: Rename 'network-interfaces' and 'all-network-interfaces'., Ludovic Courtès, 2015/07/25
- 04/06: syscalls: 'read-socket-address' gracefully handles unsupported families., Ludovic Courtès, 2015/07/25
- 05/06: syscalls: 'define-c-struct' properly align reads., Ludovic Courtès, 2015/07/25
- 06/06: syscalls: Add 'network-interfaces', which wraps libc's 'getifaddrs'., Ludovic Courtès, 2015/07/25