Skip to content

Commit 09fec2d

Browse files
jonchamUnityAlex
authored andcommitted
Add shared enum types for value type sharing in IL2CPP.
1 parent 069eb2d commit 09fec2d

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

mcs/class/corlib/LinkerDescriptor/mscorlib.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,5 +850,16 @@
850850
<type fullname="Mono.ValueTuple`3" preserve="fields"/>
851851
<type fullname="Mono.ValueTuple`4" preserve="fields"/>
852852
<type fullname="Mono.ValueTuple`5" preserve="fields"/>
853+
854+
<!-- IL2CPP enum sharing -->
855+
<type fullname="System.SByteEnum" />
856+
<type fullname="System.Int16Enum" />
857+
<type fullname="System.Int32Enum" />
858+
<type fullname="System.Int64Enum" />
859+
860+
<type fullname="System.ByteEnum" />
861+
<type fullname="System.UInt16Enum" />
862+
<type fullname="System.UInt32Enum" />
863+
<type fullname="System.UInt64Enum" />
853864
</assembly>
854865
</linker>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
3+
#if UNITY_AOT
4+
5+
namespace System
6+
{
7+
enum SByteEnum : sbyte {}
8+
enum Int16Enum : short {}
9+
enum Int32Enum : int {}
10+
enum Int64Enum : long {}
11+
12+
enum ByteEnum : byte {}
13+
enum UInt16Enum : ushort {}
14+
enum UInt32Enum : uint {}
15+
enum UInt64Enum : ulong {}
16+
}
17+
18+
#endif

mcs/class/corlib/corlib.dll.sources

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ System/Delegate.cs
9494
System/DelegateSerializationHolder.cs
9595
System/DomainManagerInitializationFlags.cs
9696
System/EmptyArray.cs
97+
System/EnumSharing.cs
9798
System/Environment.cs
9899
System/EnvironmentVariableTarget.cs
99100
System/Guid.cs

0 commit comments

Comments
 (0)