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

Anonymous Union #1760

Closed
webfolderio opened this issue Oct 19, 2019 · 1 comment
Closed

Anonymous Union #1760

webfolderio opened this issue Oct 19, 2019 · 1 comment
Assignees

Comments

@webfolderio
Copy link

webfolderio commented Oct 19, 2019

Is it possible to add annoymous union usage to CInterfaceTutorial.java

I am trying to bind libuv structures to C interface but couldn't find a proper way to do it.

Sample code snipplet:

typedef struct uv_stdio_container_s {
  uv_stdio_flags flags;

  union {
    uv_stream_t* stream;
    int fd;
  } data;
} uv_stdio_container_t;
@medoussboug
Copy link
Member

To bind native structures like uv_stdio_container_t from the libuv library to Java, you typically use Java Native Interface (JNI) or other Java Native Access (JNA) libraries. However, directly using anonymous unions in Java is not straightforward because Java does not have a native concept of unions.

@medoussboug medoussboug self-assigned this Jan 25, 2024
@medoussboug medoussboug closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2024
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

No branches or pull requests

2 participants