Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessor for array of enum inside structs is not generated #1815

Open
XzuluX opened this issue Dec 20, 2023 · 1 comment
Open

Accessor for array of enum inside structs is not generated #1815

XzuluX opened this issue Dec 20, 2023 · 1 comment
Labels

Comments

@XzuluX
Copy link

XzuluX commented Dec 20, 2023

Brief Description

In a C header, a one-dimensional array of enum values is defined within a structure.
The generated C# code does not have a property or accessor for this array.

OS: Linux Ubuntu 22.04.3 LTS

Used headers
#ifdef __cplusplus
extern "C" {
#endif

#define NR_PIXEL  10 

typedef enum
{
    LED_OFF = 0,
    LED_GREEN,
    LED_YELLOW,
    LED_RED

} sLed;

typedef struct 
{
    sLed led[NR_PIXEL];

} sPdOut;

#ifdef __cplusplus
}
#endif
Used settings

Target: Clang

Stack trace or incompilable generated code

Inside the generated code there is only a fixed uint array but no accessor.

[StructLayout(LayoutKind.Sequential, Size = 40)]
public partial struct __Internal
{
    internal fixed uint led[10];
   ...
}
@tritao tritao added the bug label Dec 20, 2023
@tritao
Copy link
Collaborator

tritao commented Dec 20, 2023

Related to: #1238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants