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:
		
							parent
							
								
									b89e74054e
								
							
						
					
					
						commit
						4a30e84e61
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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)))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue