Skip to content

Commit 621fd67

Browse files
committed
Use long for enums to match code from Godot Mono
1 parent 070d88b commit 621fd67

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

GDExtensionBindgen/LuaCoroutine.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ protected LuaCoroutine([NotNull] RefCounted @object) : base(@object)
4646

4747
#region Enums
4848

49-
public enum LuaCoroutineStatusEnum
49+
public enum LuaCoroutineStatusEnum : long
5050
{
51-
StatusOk = 0,
52-
StatusYield = 1,
53-
StatusErrrun = 2,
54-
StatusErrsyntax = 3,
55-
StatusErrmem = 4,
56-
StatusErrerr = 5,
57-
StatusDead = -1,
51+
StatusOk = 0L,
52+
StatusYield = 1L,
53+
StatusErrrun = 2L,
54+
StatusErrsyntax = 3L,
55+
StatusErrmem = 4L,
56+
StatusErrerr = 5L,
57+
StatusDead = -1L,
5858
}
5959

6060
#endregion

GDExtensionBindgen/LuaError.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ public class SignalName : RefCounted.SignalName
5151

5252
#region Enums
5353

54-
public enum StatusEnum
55-
{
56-
Ok = 0,
57-
Yielded = 1,
58-
Runtime = 2,
59-
Memory = 4,
60-
Handler = 5,
61-
Gc = 7,
62-
Syntax = 3,
63-
File = 6,
54+
public enum StatusEnum : long
55+
{
56+
Ok = 0L,
57+
Yielded = 1L,
58+
Runtime = 2L,
59+
Memory = 4L,
60+
Handler = 5L,
61+
Gc = 7L,
62+
Syntax = 3L,
63+
File = 6L,
6464
}
6565

6666
#endregion

GDExtensionBindgen/LuaState.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,28 @@ public class SignalName : RefCounted.SignalName
5656
#region Enums
5757

5858
[Flags]
59-
public enum LibraryEnum
60-
{
61-
LuaBase = 1,
62-
LuaPackage = 2,
63-
LuaCoroutine = 4,
64-
LuaString = 8,
65-
LuaOs = 16,
66-
LuaMath = 32,
67-
LuaTable = 64,
68-
LuaDebug = 128,
69-
LuaBit32 = 256,
70-
LuaIo = 512,
71-
LuaFfi = 1024,
72-
LuaJit = 2048,
73-
LuaUtf8 = 4096,
74-
LuaAllLibs = 8191,
75-
GodotVariant = 8192,
76-
GodotUtilityFunctions = 16384,
77-
GodotSingletons = 32768,
78-
GodotClasses = 65536,
79-
GodotEnums = 131072,
80-
GodotAllLibs = 253952,
59+
public enum LibraryEnum : long
60+
{
61+
LuaBase = 1L,
62+
LuaPackage = 2L,
63+
LuaCoroutine = 4L,
64+
LuaString = 8L,
65+
LuaOs = 16L,
66+
LuaMath = 32L,
67+
LuaTable = 64L,
68+
LuaDebug = 128L,
69+
LuaBit32 = 256L,
70+
LuaIo = 512L,
71+
LuaFfi = 1024L,
72+
LuaJit = 2048L,
73+
LuaUtf8 = 4096L,
74+
LuaAllLibs = 8191L,
75+
GodotVariant = 8192L,
76+
GodotUtilityFunctions = 16384L,
77+
GodotSingletons = 32768L,
78+
GodotClasses = 65536L,
79+
GodotEnums = 131072L,
80+
GodotAllLibs = 253952L,
8181
}
8282

8383
#endregion

addons/csharp_gdextension_bindgen/csharp_gdextension_bindgen.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ static func _generate_enum(cls_name: StringName, enum_name: StringName) -> Strin
234234
var constants = PackedStringArray()
235235
for constant_name in ClassDB.class_get_enum_constants(cls_name, enum_name, true):
236236
var constant_value = ClassDB.class_get_integer_constant(cls_name, constant_name)
237-
constants.append(constant_name.to_pascal_case() + " = " + str(constant_value) + ",")
237+
constants.append(constant_name.to_pascal_case() + " = " + str(constant_value) + "L,")
238238

239239
return """
240240
{flags}
241-
public enum {enum_name}Enum
241+
public enum {enum_name}Enum : long
242242
{
243243
{constants}
244244
}

0 commit comments

Comments
 (0)