• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: objc_msgSend problems on x86
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: objc_msgSend problems on x86
      • From: Rosyna <email@hidden>
References: 
 >Re: objc_msgSend problems on x86 (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: Converting HIPoints to CGPoints/NSPoints in global space?
  • Next by Date: Re: objc_msgSend problems on x86
  • Previous by thread: Re: objc_msgSend problems on x86
  • Next by thread: Re: objc_msgSend problems on x86
  • Index(es):
    • Date
    • Thread