Re: objc_msgSend problems on x86
Re: objc_msgSend problems on x86
- Subject: Re: objc_msgSend problems on x86
- From: Damien Bobillot <email@hidden>
- Date: Sun, 12 Feb 2006 22:59:41 +0100
Greg Parker wrote :
Don't do this. In the BOOL case it works, I think. In other cases
it fails (for example, if you cast to double instead of BOOL).
Using an appropriately-typed function pointer always works.
According to the objc-runtime.h header, one must use
objc_msgSend_fpret on i386 for methods returning a double value :
/* Floating-point-returning Messaging Primitives (prototypes)
*
* On some platforms, the ABI for functions returning a floating-point
* value is incompatible with that for functions returning an integral
type.
* objc_msgSend_fpret must be used for these.
*
* ppc: objc_msgSend_fpret not used
* ppc64: objc_msgSend_fpret not used
* i386: objc_msgSend_fpret REQUIRED
*
* For `float` or `long double` return types, cast the function
* to an appropriate function pointer type first.
*/
#ifdef __i386__
OBJC_EXPORT double objc_msgSend_fpret(id self, SEL op, ...);
#endif
--
Damien Bobillot
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden