I have a question about how to map Objective-C types to C# types when writing bindings.
I want to write some bindings for the Accelerate framework that is for both OSX and iOS. Writing the binding is straight forward but I am not sure about the right approach to ensure the types of the parameters are the correct size. E.g. Use a UInt32 versus a UInt versus a UInt16 when the type in the Accelerate framework is an int. And what about the storage required for an enum? C# is an int which is 32 bits - but does Objective-C follow the rules of ANSI-C?
In ANSI-C the storage requirement of an int is "a minimum of 16 bits." I am not sure what the rules are for Objective-C and C# - and whether there are other types I need to care about when writing bindings for cross-platform development.
I think the reason I need to care about this is because when I call the library each parameter will have used up a number of bytes on the stack and if the sizes are wrong the parameters will be popped off the stack incorrectly in the library.
The way I am handling this at the moment is writing some Objective-C and displaying the sizeof() before I write the binding - is there a smarter way?
Can anyone please point me to some rules on type size conversion when writing bindings?