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

Add failing test to illustrate issue #319

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mcsherrylabs
Copy link

I've added a test to show the issue I'm facing.

It looks like there is no way to pass a struct by value.

Any help appreciated?
If it's not possible, is it on the way by any chance?
Any recommendations? (I don't have access to the original code, but I could use SWIG?)

@mcsherrylabs mcsherrylabs marked this pull request as ready for review February 15, 2023 14:52
@mcsherrylabs
Copy link
Author

@headius .... any steer appreciated ....

@headius
Copy link
Member

headius commented Feb 15, 2023

I'll look into this tonight or early tomorrow! Thanks for the case.

@headius
Copy link
Member

headius commented Feb 15, 2023

Could you open a bug describing the problem? Link to this test case so I or someone else can see exactly what the problem is.

@mcsherrylabs
Copy link
Author

mcsherrylabs commented Feb 16, 2023

Could you open a bug describing the problem? Link to this test case so I or someone else can see exactly what the problem is.

I can do that. But I'm not sure it's an issue or my inexperience. Perhaps the solution is simple?

I can't find a way to have the c function interpret the struct by value ...

I can do this

long struct_num_al_test(SomeStruct *s) { return s -> count; }

using something in java like

public long struct_num_al_test(SomeStruct s);

But I cannot do this

long struct_num_al_test(SomeStruct s) { return s.count; }

Is this a bug?

@headius
Copy link
Member

headius commented Feb 16, 2023

Ok thank you, that really helps me understand the problem!

I will need to poke around a bit to see if passing structs by value is supported. I'd say based on your test case, it is not, but I'm not sure if that is intentional (not implemented) or a bug (should work but doesn't and nobody realized until now).

@basshelal
Copy link
Contributor

@headius We don't (yet) support Struct by value, see #14 .
I've been trying to do some cleanups to safely add missing features (this one is the highest priority) but haven't had much free time to do so and I've found the code quite tricky to manage and understand.

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.

None yet

3 participants