From 8a93b3ce695003d07c8d8e4c71153c0130372c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 20 Jul 2020 03:59:10 +0200 Subject: Cleanup for cpp. --- module/c/cpp.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/c') diff --git a/module/c/cpp.scm b/module/c/cpp.scm index 69e21d27..2fe842c8 100644 --- a/module/c/cpp.scm +++ b/module/c/cpp.scm @@ -114,7 +114,10 @@ (string-append "cpp -dM " header-file)) read-lines))) -(define-macro (include# header-file) +(define-macro (include# header-file . args) + + (define define-form (if (null? args) 'define (car args))) + (define lines (remove (compose private-c-symbol? car) (tokenize-header-file header-file))) @@ -131,7 +134,7 @@ (define graph (add-node graph* (cons '_POSIX_VDISABLE #f) '())) `(begin - ,@(map (lambda (pair) `(define ,(car pair) ,(cdr pair))) + ,@(map (lambda (pair) `(,define-form ,(car pair) ,(cdr pair))) (resolve-dependency-graph graph)))) -- cgit v1.2.3