header generator: fix bitsets in odin 4

This commit is contained in:
nakst 2022-02-13 21:08:09 +00:00
parent 7444967ece
commit 8be749ce31
1 changed files with 3 additions and 1 deletions

View File

@ -923,6 +923,7 @@ void OutputOdinFunction(Entry *entry, Entry *root) {
const char *initialValue = TrimPrefix(variable->variable.initialValue);
bool needLeadingDot = false;
const char *leadingTypeName = "";
if (0 == strcmp(initialValue, "NULL")) {
initialValue = "nil";
@ -947,6 +948,7 @@ void OutputOdinFunction(Entry *entry, Entry *root) {
if (0 == memcmp(initialValue, entry->bitset.definePrefix + 3, strlen(entry->bitset.definePrefix) - 3)) {
needLeadingDot = true;
initialValue += strlen(entry->bitset.definePrefix) - 3;
leadingTypeName = TrimPrefix(entry->name);
}
break;
@ -954,7 +956,7 @@ void OutputOdinFunction(Entry *entry, Entry *root) {
}
}
FilePrintFormat(output, " = %c%s", needLeadingDot ? '.' : ' ', initialValue);
FilePrintFormat(output, " = %s%c%s", leadingTypeName, needLeadingDot ? '.' : ' ', initialValue);
}
}