Add a C++ backend for LibertyXDR

Also change the C backend so that it also de/serializes
unions without any other fields besides the tag.
This commit is contained in:
2023-07-07 12:25:14 +02:00
parent f78f8a70f1
commit 2edc9c6fd1
13 changed files with 638 additions and 12 deletions

View File

@@ -439,7 +439,7 @@ function codegen_struct(name, cg, gotype) {
delete cg[i]
}
function codegen_union_tag(d, cg) {
function codegen_union_tag(name, d, cg) {
cg["tagtype"] = d["type"]
cg["tagname"] = snaketocamel(d["name"])
# The tag is implied from the type of struct stored in the interface.