Skip to content

Commit 5fe333a

Browse files
committed
Ignore static fields in structures.
1 parent bab93b7 commit 5fe333a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/CodeGenerator/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,14 @@ static void Main(string[] args)
146146
string name = jp.Name;
147147
TypeReference[] fields = jp.Values().Select(v =>
148148
{
149+
if (v["type"].ToString().Contains("static")) { return null; }
150+
149151
return new TypeReference(
150152
v["name"].ToString(),
151153
v["type"].ToString(),
152154
v["template_type"]?.ToString(),
153155
enums);
154-
}).ToArray();
156+
}).Where(tr => tr != null).ToArray();
155157
return new TypeDefinition(name, fields);
156158
}).ToArray();
157159

src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace ImGuiNET
88
public unsafe partial struct ImGuiTextBuffer
99
{
1010
public ImVector Buf;
11-
public static char EmptyString_0;
1211
}
1312
public unsafe partial struct ImGuiTextBufferPtr
1413
{
@@ -19,7 +18,6 @@ public unsafe partial struct ImGuiTextBufferPtr
1918
public static implicit operator ImGuiTextBuffer* (ImGuiTextBufferPtr wrappedPtr) => wrappedPtr.NativePtr;
2019
public static implicit operator ImGuiTextBufferPtr(IntPtr nativePtr) => new ImGuiTextBufferPtr(nativePtr);
2120
public ImVector<byte> Buf => new ImVector<byte>(NativePtr->Buf);
22-
public RangeAccessor<static char> EmptyString => new RangeAccessor<static char>(&NativePtr->EmptyString_0, 1);
2321
public void appendf(string fmt)
2422
{
2523
byte* native_fmt;

0 commit comments

Comments
 (0)