syscalls: Adjust 'define-bits' to macro literal semantics of 2.2.

* guix/build/syscalls.scm (define-bits): Do not define NAMES... as
top-level variables since that prevents literal matches in 2.2.
Instead, determine constant values at expansion time.
This commit is contained in:
Ludovic Courtès 2017-03-12 17:35:32 +01:00
parent 239c22663a
commit 334c95306a
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1346,12 +1346,12 @@ (define-syntax define-bits
(begin
(define-syntax constructor
(syntax-rules (names ...)
((_) 0)
((_ names) values) ...
((_ several (... ...))
(logior (constructor several) (... ...)))))
((_ first rest (... ...))
(logior (constructor first) rest (... ...)))))
(define (bits->symbols bits)
(bits->symbols-body bits (names ...) (values ...)))
(define names values) ...))))
(bits->symbols-body bits (names ...) (values ...)))))))
;; 'local-flags' bits from <bits/termios.h>
(define-bits local-flags