syscalls: C struct writer correctly handles pointer fields.
* guix/build/syscalls.scm (write-type): Add case for '*.
This commit is contained in:
parent
d87c201f96
commit
f43714e620
|
@ -202,7 +202,7 @@ result is the alignment of the \"most strictly aligned component\"."
|
||||||
types ...))))
|
types ...))))
|
||||||
|
|
||||||
(define-syntax write-type
|
(define-syntax write-type
|
||||||
(syntax-rules (~ array)
|
(syntax-rules (~ array *)
|
||||||
((_ bv offset (type ~ order) value)
|
((_ bv offset (type ~ order) value)
|
||||||
(bytevector-uint-set! bv offset value
|
(bytevector-uint-set! bv offset value
|
||||||
(endianness order) (sizeof* type)))
|
(endianness order) (sizeof* type)))
|
||||||
|
@ -215,6 +215,9 @@ result is the alignment of the \"most strictly aligned component\"."
|
||||||
((head . tail)
|
((head . tail)
|
||||||
(write-type bv o type head)
|
(write-type bv o type head)
|
||||||
(loop (+ 1 i) tail (+ o (sizeof* type))))))))
|
(loop (+ 1 i) tail (+ o (sizeof* type))))))))
|
||||||
|
((_ bv offset '* value)
|
||||||
|
(bytevector-uint-set! bv offset (pointer-address value)
|
||||||
|
(native-endianness) (sizeof* '*)))
|
||||||
((_ bv offset type value)
|
((_ bv offset type value)
|
||||||
(bytevector-uint-set! bv offset value
|
(bytevector-uint-set! bv offset value
|
||||||
(native-endianness) (sizeof* type)))))
|
(native-endianness) (sizeof* type)))))
|
||||||
|
|
Loading…
Reference in New Issue