On Fri, Feb 29, 2008 at 2:46 PM, Greg Parker <[EMAIL PROTECTED]> wrote:
> > When in doubt, write Objective-C code that returns the type you want, > compile it, and use whichever function the generated assembly code > chose. What's your advice about what to do when the choice must be made at runtime? I'm using libffi. Does it know about the implicit first argument for struct returns? That is, do I take the moral equivalent of the suggestion in objc/objc-runtime.h, call objc_msgSend_stret() using a struct return type and leave the argument shuffling for ffi to handle? Or, do I call it as declared, with a void return type, setting up the return pointer argument myself and disregarding the comment in the header file? Also, do you know what, if any, type promotions are relevant, and whether libffi automatically handles them? I'm (slowly) updating CamelBones, replacing libffcall with libffi. Ffcall is fairly limited in its structure handling - structure components have to be known at compile time, whereas libffi's struct definition metadata can be assembled at run time. That capability is a must, if I'm to be able to read .bridgesupport metadata, hence the switch. sherm-- _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]