Add Suffix

This commit is contained in:
TheBrokenRail 2024-01-06 03:30:32 -05:00
parent 92bb2b8191
commit 5e2934a399
2 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ export class Method {
}
// Generate Variable Definition
generateDefinition() {
return `${this.getType()} ${this.getName()};\n`;
generateDefinition(nameSuffix?: string) {
return `${this.getType()} ${this.getName()}${nameSuffix !== undefined ? nameSuffix : ''};\n`;
}
}

View File

@ -117,7 +117,7 @@ export class VTable implements Property {
if (info) {
const type = `${info.getType()} *`;
out += `extern ${type}${info.getName()}_vtable_addr;\n`;
out += `extern ${info.generateDefinition()}`;
out += `extern ${info.generateDefinition('_non_virtual')}`;
}
}
}
@ -152,7 +152,7 @@ export class VTable implements Property {
const type = `${info.getType()} *`;
init += `${INDENT}${info.getName()}_vtable_addr = (${type}) ${vtableAddress};\n`;
declarations += `${type}${info.getName()}_vtable_addr;\n`;
init += `${INDENT}${info.getName()} = *${info.getName()}_vtable_addr;\n`;
init += `${INDENT}${info.getName()}_non_virtual = *${info.getName()}_vtable_addr;\n`;
declarations += info.generateDefinition();
}
}