Timothy Wall <twalljava@...> writes:
Since C determines the memory layout based on the order of
declaration, this is not exactly an onerous burden.
I'm aware of this fact and of course my request is not a lament on that.
I just encoutered the problem and I wanted to know if there was a solution.
I think you're leaving out some critical details about what you're
trying to accomplish. Do you have some other high-level language
which is auto-generating the struct layout? You will *always* need
to tell the Java side how to map its struct fields into memory,
whether it's by convention or explicit configuration.
Both side (Java and C++) a generated from a model and I have no control on
the order in which fields are created.
Around the same subject, I've slightly modified the JNA source to gain a
better control on the field order by using Java annotations. I mean that
in a class extending Structure, I can choose which fields will be taken
into account for the mapping and in which order. I just noticed that a new
version was available, but anyway if someone is interested I may post the
changes.
Thank you anyway for your reply
Nicolas