Skip to content

Commit 98dc7db

Browse files
committed
Add shared enum types for value type sharing in IL2CPP.
1 parent 8a0e781 commit 98dc7db

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
@@ -842,5 +842,16 @@
842842
<type fullname="Mono.RuntimeStructs/HandleStackMark" />
843843
<!-- marshal.c (mono_marshal_get_native_wrapper) -->
844844
<type fullname="Mono.RuntimeStructs/MonoError" />
845+
846+
<!-- IL2CPP enum sharing -->
847+
<type fullname="System.SByteEnum" />
848+
<type fullname="System.Int16Enum" />
849+
<type fullname="System.Int32Enum" />
850+
<type fullname="System.Int64Enum" />
851+
852+
<type fullname="System.ByteEnum" />
853+
<type fullname="System.UInt16Enum" />
854+
<type fullname="System.UInt32Enum" />
855+
<type fullname="System.UInt64Enum" />
845856
</assembly>
846857
</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
@@ -104,6 +104,7 @@ System/Delegate.cs
104104
System/DelegateSerializationHolder.cs
105105
System/DomainManagerInitializationFlags.cs
106106
System/EmptyArray.cs
107+
System/EnumSharing.cs
107108
System/Environment.cs
108109
System/EnvironmentVariableTarget.cs
109110
System/Guid.cs

0 commit comments

Comments
 (0)