• 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: Rosyna <email@hidden>
  • Date: Sun, 12 Feb 2006 15:03:55 -0700

BOOL is not a floating point value... so using objc_msgSend_fpret() to call a method that returns BOOL would be especially heinous.

Ack, at 2/12/06, Damien Bobillot said:

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

--


Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
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


References: 
 >Re: objc_msgSend problems on x86 (From: Greg Parker <email@hidden>)
 >Re: objc_msgSend problems on x86 (From: Damien Bobillot <email@hidden>)

  • Prev by Date: Re: objc_msgSend problems on x86
  • Next by Date: Who's launching me?
  • Previous by thread: Re: objc_msgSend problems on x86
  • Next by thread: Update the scroller in a NSScrollView from its documentView ?
  • Index(es):
    • Date
    • Thread