-
Notifications
You must be signed in to change notification settings - Fork 61
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
Mapping a struct return type #49
Comments
@castortech Have you been able to work around this? Also hitting the same issue |
I just needed a coordinate (x,z). I did this unholy fuck: long long getNearestStructure(int structType, int x, int z, uint64_t seed, int mc, int searchSize) {
...
return ((long long)bestPos.x << 32) | (bestPos.z & 0xffffffffL);
} long result = getNearestStructure(structType, x, z, seed, mc_version, searchSize);
if (result == 0) {
return null;
}
Pos pos = new Pos();
pos.x = (int) (result >> 32);
pos.z = (int) (result & 0xFFFFFFFF);
return pos; |
Hacked my way around it as well. |
May I ask how you did it? My workarounds don't feel very elegant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a C function that returns a struct such as (and also other variants)
That doesn't seem to be supported as per the following error:
while the documentation states:
So what is the best way to handle this. Was thinking of returning a byte array but concerned that since many member types can have varying size that would force me to capture many sizeof.
The text was updated successfully, but these errors were encountered: