From b2033f6d6d8918ed9ac72468aaa5faf96f8157dd Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 25 May 2025 16:41:43 -0400 Subject: Optimize codegen for enums: no longer bother with a struct wrapper, but just use a C enum type instead. This will make it easier to use externally defined enums in the future. --- src/structs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/structs.c') diff --git a/src/structs.c b/src/structs.c index b398b871..88de7aac 100644 --- a/src/structs.c +++ b/src/structs.c @@ -69,7 +69,7 @@ CORD compile_struct_header(env_t *env, ast_t *ast) CORD typeinfo_code = CORD_all("extern const TypeInfo_t ", typeinfo_name, ";\n"); CORD optional_code = CORD_EMPTY; if (!def->opaque) { - optional_code = CORD_all("DEFINE_OPTIONAL_TYPE(", compile_type(t), ", ", unpadded_size, ",", + optional_code = CORD_all("DEFINE_OPTIONAL_TYPE(", compile_type(t), ", ", unpadded_size, ", ", namespace_name(env, env->namespace, CORD_all("$Optional", def->name, "$$type")), ");\n"); } return CORD_all(struct_code, optional_code, typeinfo_code); -- cgit v1.2.3