Fixed, working unions. Had to move the is_union member to the end. I'm not sure if this is a C bug or an effect of me doing something weird somewhere
This commit is contained in:
@@ -443,16 +443,15 @@ obj c_generator (Object) {
|
||||
})
|
||||
})
|
||||
type_poset.get_sorted().for_each(fun(vert: *ast_node) {
|
||||
/*var base_name = vert->type_def.name*/
|
||||
var base_name = get_name(vert)
|
||||
plain_typedefs += string("typedef ")
|
||||
/*if (is_type_def(vert) && vert->type_def.is_union) {*/
|
||||
/*plain_typedefs += "union "*/
|
||||
/*structs += "union "*/
|
||||
/*} else {*/
|
||||
if (is_type_def(vert) && vert->type_def.is_union) {
|
||||
plain_typedefs += "union "
|
||||
structs += "union "
|
||||
} else {
|
||||
plain_typedefs += "struct "
|
||||
structs += "struct "
|
||||
/*}*/
|
||||
}
|
||||
plain_typedefs += base_name + "_dummy " + base_name + ";\n"
|
||||
structs += base_name + "_dummy {\n"
|
||||
if (is_type_def(vert)) {
|
||||
|
||||
Reference in New Issue
Block a user