write every star of a pointer chain to a struct
c-struct/aux wrote the tag and the first * after it and dropped the rest, so (* * struct pt) declared a struct pt *.
This commit is contained in:
@@ -649,6 +649,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; data structures
|
||||
|
||||
;; MODIFIED FROM UPSTREAM fmt-c: behind a pointer, the rest of the
|
||||
;; chain is O -- `struct p * * q' is body `*' and O (*) -- and it was
|
||||
;; dropped, so the declaration lost all but its first star.
|
||||
(define (c-struct/aux type x . o)
|
||||
;; can be just pointer to SUC, need to support such case:
|
||||
;; struct whatever * - body is just '*'
|
||||
@@ -673,7 +676,7 @@
|
||||
(cat " " name)
|
||||
"")
|
||||
(if (not (null? body))
|
||||
(cat body)
|
||||
(apply cat body (map (lambda (t) (cat " " t)) o))
|
||||
""))))))
|
||||
|
||||
(define (c-struct . args) (apply c-struct/aux "struct" args))
|
||||
|
||||
Reference in New Issue
Block a user