Skip to content

Handle function pointer types in constant array struct naming#4

Open
deathbeam wants to merge 2 commits into
BeanCheeseBurrito:mainfrom
deathbeam:fix-binding-generator
Open

Handle function pointer types in constant array struct naming#4
deathbeam wants to merge 2 commits into
BeanCheeseBurrito:mainfrom
deathbeam:fix-binding-generator

Conversation

@deathbeam

Copy link
Copy Markdown

Use GetTypeIdentifier instead of GetTypeName for the array size suffix
to ensure the generated struct name is always a valid C# identifier.
This prevents invalid identifiers when the element type is a function
pointer or other non-identifier-compatible type.

Also derive the struct name from GetTypeName(type) directly rather than
constructing it manually, which correctly handles complex types.

Signed-off-by: Tomas Slusny slusnucky@gmail.com

Use GetTypeIdentifier instead of GetTypeName for the array size suffix
to ensure the generated struct name is always a valid C# identifier.
This prevents invalid identifiers when the element type is a function
pointer or other non-identifier-compatible type.

Also derive the struct name from GetTypeName(type) directly rather than
constructing it manually, which correctly handles complex types.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
@deathbeam deathbeam force-pushed the fix-binding-generator branch from d5c18ef to 1c44213 Compare June 19, 2026 03:04
@deathbeam

Copy link
Copy Markdown
Author

Simplified the PR a bit

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant