Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
feat: recognize generated destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiNahida committed Nov 7, 2023
1 parent 13c08d7 commit 019c23d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/kotlin/com/liteldev/headeroutput/data/MemberTypeData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,26 @@ data class MemberTypeData(
else if (valType.name.isBlank() && !isConstructor() && !isDestructor()) valType.name = "auto"
else valType.name = valType.name.replaceEnumType()
val paramsString = params.joinToString(", ") { it.name }.replaceEnumType()
if (isVirtual()) if (useFakeSymbol) append("MCVAPI ") else append("virtual ")

// Linkage specifiers
if (isVirtual())
if (useFakeSymbol) append("MCVAPI ")
else append("virtual ")
else append("MCAPI ")

if (!(isPtrCall() || isVirtual() || namespace)) append("static ")
if ((isConstructor() && !isCopyConstructor() && !isMoveConstructor() && params.size == 1) || isConversionOperator())
append("explicit ")
if (isFunctionPtr) append("auto ")
else if (valType.name != "") append("${valType.name} ")
append("$name(${paramsString})")

if (isConst()) append(" const")
if (isFunctionPtr) append(" -> ${valType.name}")
if (isPureCall()) append(" = 0")
else if (isVirtual() && !useFakeSymbol && symbol == "??1@@UEAA@XZ") append(" = default")
if (isPureCall())
append(" = 0")
else if (isVirtual() && !useFakeSymbol && symbol.startsWith("__gen_"))
append(" = default")
append(";")
}
}
Expand Down

0 comments on commit 019c23d

Please sign in to comment.