From 1f6e586b2a3fe7f8ca32ce95659032bafef0ad24 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 11 Mar 2025 17:49:04 -0400 Subject: Support external structs with namespaced methods (also C-strings are now `const char*` instead of `char*`) --- compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 203c44aa..8943dd99 100644 --- a/compile.c +++ b/compile.c @@ -511,7 +511,7 @@ CORD compile_type(type_t *t) case MutexedType: return "MutexedData_t"; case BoolType: return "Bool_t"; case ByteType: return "Byte_t"; - case CStringType: return "char*"; + case CStringType: return "const char*"; case MomentType: return "Moment_t"; case BigIntType: return "Int_t"; case IntType: return CORD_asprintf("Int%ld_t", Match(t, IntType)->bits); @@ -547,7 +547,7 @@ CORD compile_type(type_t *t) case PointerType: return CORD_cat(compile_type(Match(t, PointerType)->pointed), "*"); case StructType: { auto s = Match(t, StructType); - if (s->external) return CORD_all("struct ", s->name); + if (s->external) return s->name; return CORD_all("struct ", namespace_prefix(s->env, s->env->namespace->parent), s->name, "$$struct"); } case EnumType: { -- cgit v1.2.3