Skip to content

Commit f880b77

Browse files
committed
~
1 parent 0202c47 commit f880b77

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

il2cpp/Helper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,11 @@ private static void ClassSigName(StringBuilder sb, TypeDef tyDef)
546546
fullName);
547547
}
548548

549+
public static bool IsExtern(MethodDef metDef)
550+
{
551+
return !metDef.HasBody && !metDef.IsAbstract;
552+
}
553+
549554
public static bool IsInstanceField(FieldDef fldDef)
550555
{
551556
return !fldDef.IsStatic;

il2cpp/MethodGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,9 @@ private void GenNewobj(InstInfo inst, MethodX metX)
24462446
strAddSize,
24472447
GenContext.GetTypeID(tyX),
24482448
GenContext.IsTypeNoRef(tyX) ? "1" : "0",
2449-
tyX.FinalizerMethod != null ? ", (IL2CPP_FINALIZER_FUNC)&" + GenContext.GetMethodName(tyX.FinalizerMethod, PrefixMet) : null),
2449+
tyX.FinalizerMethod != null ?
2450+
", (IL2CPP_FINALIZER_FUNC)&" + GenContext.GetMethodName(tyX.FinalizerMethod, PrefixMet) :
2451+
null),
24502452
slotPush.SlotType);
24512453

24522454
strCode += '\n' + GenCall(metX, false, ctorArgs);

il2cpp/RuntimeInternals.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public static bool GenInternalMethod(MethodGenerator metGen, CodePrinter prt)
1212

1313
string typeName = metX.DeclType.GetNameKey();
1414
string metName = metX.Def.Name;
15+
string metSigName = metX.GetNameKey();
1516

1617
if (typeName == "Object")
1718
{
@@ -222,14 +223,6 @@ public static bool GenInternalMethod(MethodGenerator metGen, CodePrinter prt)
222223
return true;
223224
}
224225
}
225-
else if (typeName == "System.Environment")
226-
{
227-
if (metName == "GetResourceFromDefault")
228-
{
229-
prt.AppendLine("return arg_0;");
230-
return true;
231-
}
232-
}
233226
else if (typeName == "System.Threading.Monitor")
234227
{
235228
if (metName == "ReliableEnter")

il2cpp/TypeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public CompileUnit Generate()
215215
AppendRuntimeFlags(metX, prtDecl);
216216

217217
prtDecl.AppendFormatLine("// {0}{1}{2} -> {3}",
218-
!metX.Def.HasBody && !metX.Def.IsAbstract ? "extern " : null,
218+
Helper.IsExtern(metX.Def) ? "extern " : null,
219219
metX.Def.IsInternalCall ? "internalcall " : null,
220220
Helper.EscapeString(metX.DeclType.GetNameKey()),
221221
Helper.EscapeString(metX.GetReplacedNameKey()));

0 commit comments

Comments
 (0)