My C++ function
extern "C" {
DECLSPEC unsigned int STDCALL doNumberThing(unsigned int some_number);
}
My Java Interface
package com.myplace.nativeapi;
import com.sun.jna.Library;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
interface NativeAPI extends Library {
int doNumberThing(int some_number);
}
Obviously this has a problem when dealing with values that are only valid for one or the other of the mismatched types (int vs unsigned int); what is the recommended way to get around this? One answer elsewhere recommends "IntByReference", but unless I've misunderstood, they're talking about the long*, not the actual unsigned int being passed by value.
(This is trimmed down example code, if there's a syntax error, let me know in the comments and I'll update the question)