diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-11 17:49:04 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-11 17:49:04 -0400 |
| commit | 1f6e586b2a3fe7f8ca32ce95659032bafef0ad24 (patch) | |
| tree | 49b6633bf0693952153f12e8ed4dce1dae1443cc /compile.c | |
| parent | fb2d7b5379663e929ffabfbd8428de5b35ad67c4 (diff) | |
Support external structs with namespaced methods (also C-strings are now
`const char*` instead of `char*`)
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: { |
