mescc: Tinycc support: Handle short struct initializer.
* module/language/c99/compiler.mes (array-init-element->data): Handle short struct initializer.
This commit is contained in:
parent
029c000840
commit
932b38980e
|
@ -2101,12 +2101,16 @@
|
||||||
((initzer (p-expr (fixed ,fixed)))
|
((initzer (p-expr (fixed ,fixed)))
|
||||||
(int->bv type (expr->number info fixed)))
|
(int->bv type (expr->number info fixed)))
|
||||||
((initzer (initzer-list . ,inits))
|
((initzer (initzer-list . ,inits))
|
||||||
(if (structured-type? type)
|
(if (structured-type? type)
|
||||||
(map (cut init->data <> <> info) (map cdr (struct->init-fields type)) inits)
|
(let* ((fields (map cdr (struct->init-fields type)))
|
||||||
(begin
|
(missing (max 0 (- (length fields) (length inits))))
|
||||||
(stderr "array-init-element->data: oops:~s\n" o)
|
(inits (append inits
|
||||||
(stderr "type:~s\n" type)
|
(map (const '(fixed "0")) (iota missing)))))
|
||||||
(error "array-init-element->data: not supported: " o))))
|
(map (cut init->data <> <> info) fields inits))
|
||||||
|
(begin
|
||||||
|
(stderr "array-init-element->data: oops:~s\n" o)
|
||||||
|
(stderr "type:~s\n" type)
|
||||||
|
(error "array-init-element->data: not supported: " o))))
|
||||||
(_ (init->data type o info))
|
(_ (init->data type o info))
|
||||||
(_ (error "array-init-element->data: not supported: " o))))
|
(_ (error "array-init-element->data: not supported: " o))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue